home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / M / MacStarter.sit / globals-MacStarter.c < prev    next >
MacBinary  |  1992-10-11  |  15.5 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: globals-MacStarter.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Sun Oct 11 15:34:09 1992, modified Sun Oct 11 15:34:09 1992, creator Think C, type ASCII, 15270 bytes "globals-MacStarter.c" , at 0x3c26 368 bytes resource default (weak)
99% file data default
49% TrID Macintosh plain text (MacBinary) default
33% TrID raw Group 3 FAX bitmap default (weak)
16% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 14 67 6c 6f 62 61 6c | 73 2d 4d 61 63 53 74 61 |..global|s-MacSta|
|00000010| 72 74 65 72 2e 63 00 00 | 00 00 00 00 00 00 00 00 |rter.c..|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 3b a6 00 | 00 01 70 a6 fe 32 31 a6 |.....;..|..p..21.|
|00000060| fe 32 31 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.21.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 b3 01 00 00 |........|........|
|00000080| 2f 2a 20 4d 61 63 53 74 | 61 72 74 65 72 20 69 73 |/* MacSt|arter is|
|00000090| 20 61 20 73 68 65 6c 6c | 20 66 6f 72 20 73 69 6d | a shell| for sim|
|000000a0| 70 6c 65 20 4d 61 63 69 | 6e 74 6f 73 68 20 61 70 |ple Maci|ntosh ap|
|000000b0| 70 6c 69 63 61 74 69 6f | 6e 73 20 73 68 65 6c 6c |plicatio|ns shell|
|000000c0| 20 77 72 69 74 74 65 6e | 20 69 6e 0d 20 20 20 54 | written| in. T|
|000000d0| 48 49 4e 4b 20 43 2c 20 | 77 69 74 68 20 73 6f 6d |HINK C, |with som|
|000000e0| 65 20 73 6d 61 6c 6c 20 | 75 73 65 20 6f 66 20 69 |e small |use of i|
|000000f0| 74 73 20 6f 62 6a 65 63 | 74 2d 6f 72 69 65 6e 74 |ts objec|t-orient|
|00000100| 65 64 20 66 65 61 74 75 | 72 65 73 2e 0d 20 20 20 |ed featu|res.. |
|00000110| 54 68 65 20 77 68 6f 6c | 65 20 73 79 73 74 65 6d |The whol|e system|
|00000120| 20 69 73 20 64 65 73 63 | 72 69 62 65 64 20 69 6e | is desc|ribed in|
|00000130| 20 61 20 52 45 41 44 4d | 45 20 66 69 6c 65 20 74 | a READM|E file t|
|00000140| 68 61 20 73 68 6f 75 6c | 64 20 62 65 20 69 6e 20 |ha shoul|d be in |
|00000150| 0d 20 20 20 74 68 65 20 | 73 61 6d 65 20 66 6f 6c |. the |same fol|
|00000160| 64 65 72 20 77 69 74 68 | 20 74 68 69 73 20 66 69 |der with| this fi|
|00000170| 6c 65 2e 20 20 54 68 65 | 72 65 20 61 72 65 20 6e |le. The|re are n|
|00000180| 6f 20 63 6f 6d 6d 65 6e | 74 73 20 6f 6e 20 74 68 |o commen|ts on th|
|00000190| 69 73 20 66 69 6c 65 2e | 0d 20 20 20 59 6f 75 20 |is file.|. You |
|000001a0| 73 68 6f 75 6c 64 20 6e | 6f 74 20 6e 65 65 64 20 |should n|ot need |
|000001b0| 74 6f 20 6b 6e 6f 77 20 | 74 68 65 20 69 6d 70 6c |to know |the impl|
|000001c0| 65 6d 65 6e 74 61 74 69 | 6f 6e 20 6f 66 20 61 6e |ementati|on of an|
|000001d0| 79 20 6f 66 20 74 68 65 | 20 66 75 6e 63 74 69 6f |y of the| functio|
|000001e0| 6e 73 0d 20 20 20 77 72 | 69 74 74 65 6e 20 68 65 |ns. wr|itten he|
|000001f0| 72 65 2e 20 20 49 6e 66 | 6f 72 6d 61 74 69 6f 6e |re. Inf|ormation|
|00000200| 20 6f 6e 20 77 68 61 74 | 20 69 73 20 61 76 61 69 | on what| is avai|
|00000210| 6c 61 62 6c 65 20 66 72 | 6f 6d 20 74 68 69 73 20 |lable fr|om this |
|00000220| 66 69 6c 65 20 66 6f 72 | 0d 20 20 20 79 6f 75 20 |file for|. you |
|00000230| 74 6f 20 75 73 65 20 65 | 6c 73 65 77 68 65 72 65 |to use e|lsewhere|
|00000240| 20 69 6e 20 79 6f 75 72 | 20 70 72 6f 67 72 61 6d | in your| program|
|00000250| 20 69 73 20 69 6e 20 74 | 68 65 20 52 45 41 44 4d | is in t|he READM|
|00000260| 45 20 66 69 6c 65 2e 0d | 2a 2f 0d 0d 23 69 6e 63 |E file..|*/..#inc|
|00000270| 6c 75 64 65 20 22 67 6c | 6f 62 61 6c 73 2d 4d 61 |lude "gl|obals-Ma|
|00000280| 63 53 74 61 72 74 65 72 | 2e 68 22 0d 23 69 6e 63 |cStarter|.h".#inc|
|00000290| 6c 75 64 65 20 22 73 74 | 64 6c 69 62 2e 68 22 0d |lude "st|dlib.h".|
|000002a0| 0d 45 76 65 6e 74 52 65 | 63 6f 72 64 20 67 45 76 |.EventRe|cord gEv|
|000002b0| 65 6e 74 3b 0d 69 6e 74 | 20 67 43 6c 69 63 6b 43 |ent;.int| gClickC|
|000002c0| 6f 75 6e 74 20 3d 20 30 | 3b 0d 6c 6f 6e 67 20 6c |ount = 0|;.long l|
|000002d0| 61 73 74 43 6c 69 63 6b | 54 69 6d 65 20 3d 20 30 |astClick|Time = 0|
|000002e0| 3b 0d 50 6f 69 6e 74 20 | 6c 61 73 74 43 6c 69 63 |;.Point |lastClic|
|000002f0| 6b 50 74 20 3d 20 7b 20 | 30 2c 30 20 7d 3b 0d 52 |kPt = { |0,0 };.R|
|00000300| 65 63 74 20 67 57 69 6e | 64 6f 77 52 65 63 74 20 |ect gWin|dowRect |
|00000310| 3d 20 7b 20 30 2c 30 2c | 30 2c 30 20 7d 3b 0d 78 |= { 0,0,|0,0 };.x|
|00000320| 57 69 6e 64 6f 77 20 2a | 78 57 69 6e 64 6f 77 4c |Window *|xWindowL|
|00000330| 69 73 74 20 3d 20 30 3b | 0d 0d 69 6e 74 20 78 57 |ist = 0;|..int xW|
|00000340| 69 6e 64 6f 77 3a 3a 57 | 69 6e 64 6f 77 32 58 57 |indow::W|indow2XW|
|00000350| 69 6e 64 6f 77 28 57 69 | 6e 64 6f 77 50 74 72 20 |indow(Wi|ndowPtr |
|00000360| 77 69 6e 2c 20 78 57 69 | 6e 64 6f 77 2a 2a 20 78 |win, xWi|ndow** x|
|00000370| 57 69 6e 29 20 7b 0d 20 | 20 20 78 57 69 6e 64 6f |Win) {. | xWindo|
|00000380| 77 20 2a 72 75 6e 3b 0d | 20 20 20 72 75 6e 20 3d |w *run;.| run =|
|00000390| 20 78 57 69 6e 64 6f 77 | 4c 69 73 74 3b 0d 20 20 | xWindow|List;. |
|000003a0| 20 77 68 69 6c 65 20 28 | 20 72 75 6e 20 26 26 20 | while (| run && |
|000003b0| 72 75 6e 2d 3e 74 68 65 | 57 69 6e 64 6f 77 20 21 |run->the|Window !|
|000003c0| 3d 20 77 69 6e 20 29 0d | 20 20 20 20 20 20 72 75 |= win ).| ru|
|000003d0| 6e 20 3d 20 72 75 6e 2d | 3e 6e 65 78 74 57 69 6e |n = run-|>nextWin|
|000003e0| 64 6f 77 3b 0d 20 20 20 | 2a 78 57 69 6e 20 3d 20 |dow;. |*xWin = |
|000003f0| 72 75 6e 3b 0d 20 20 20 | 72 65 74 75 72 6e 20 28 |run;. |return (|
|00000400| 72 75 6e 20 21 3d 20 30 | 29 3b 0d 7d 0d 0d 0d 76 |run != 0|);.}...v|
|00000410| 6f 69 64 20 78 57 69 6e | 64 6f 77 3a 3a 53 65 74 |oid xWin|dow::Set|
|00000420| 44 65 66 61 75 6c 74 73 | 28 76 6f 69 64 29 20 7b |Defaults|(void) {|
|00000430| 0d 20 20 66 65 61 74 75 | 72 65 73 20 3d 20 68 61 |. featu|res = ha|
|00000440| 73 48 53 63 72 6f 6c 6c | 20 2b 20 68 61 73 56 53 |sHScroll| + hasVS|
|00000450| 63 72 6f 6c 6c 20 2b 20 | 68 61 73 47 6f 41 77 61 |croll + |hasGoAwa|
|00000460| 79 20 2b 20 68 61 73 5a | 6f 6f 6d 20 2b 20 68 61 |y + hasZ|oom + ha|
|00000470| 73 47 72 6f 77 3b 0d 20 | 20 74 6f 70 53 63 72 6f |sGrow;. | topScro|
|00000480| 6c 6c 4f 66 66 73 65 74 | 20 3d 20 30 3b 0d 20 20 |llOffset| = 0;. |
|00000490| 62 6f 74 74 6f 6d 53 63 | 72 6f 6c 6c 4f 66 66 73 |bottomSc|rollOffs|
|000004a0| 65 74 20 3d 20 30 3b 0d | 20 20 6c 65 66 74 53 63 |et = 0;.| leftSc|
|000004b0| 72 6f 6c 6c 4f 66 66 73 | 65 74 20 3d 20 30 3b 0d |rollOffs|et = 0;.|
|000004c0| 20 20 72 69 67 68 74 53 | 63 72 6f 6c 6c 4f 66 66 | rightS|crollOff|
|000004d0| 73 65 74 20 3d 20 30 3b | 0d 20 20 6d 69 6e 48 20 |set = 0;|. minH |
|000004e0| 3d 20 35 30 3b 0d 20 20 | 6d 69 6e 56 20 3d 20 35 |= 50;. |minV = 5|
|000004f0| 30 3b 0d 20 20 6d 61 78 | 48 20 3d 20 33 32 30 30 |0;. max|H = 3200|
|00000500| 30 3b 0d 20 20 6d 61 78 | 56 20 3d 20 33 32 30 30 |0;. max|V = 3200|
|00000510| 30 3b 0d 20 20 68 4c 69 | 6e 65 73 50 65 72 50 61 |0;. hLi|nesPerPa|
|00000520| 67 65 20 3d 20 31 3b 0d | 20 20 76 4c 69 6e 65 73 |ge = 1;.| vLines|
|00000530| 50 65 72 50 61 67 65 20 | 3d 20 31 3b 0d 7d 0d 0d |PerPage |= 1;.}..|
|00000540| 76 6f 69 64 20 78 57 69 | 6e 64 6f 77 3a 3a 4f 70 |void xWi|ndow::Op|
|00000550| 65 6e 49 6e 52 65 63 74 | 28 53 74 72 32 35 35 20 |enInRect|(Str255 |
|00000560| 74 69 74 6c 65 2c 20 69 | 6e 74 20 6c 65 66 74 2c |title, i|nt left,|
|00000570| 20 69 6e 74 20 74 6f 70 | 2c 20 69 6e 74 20 72 69 | int top|, int ri|
|00000580| 67 68 74 2c 20 69 6e 74 | 20 62 6f 74 74 6f 6d 29 |ght, int| bottom)|
|00000590| 20 7b 0d 20 20 20 69 6e | 74 20 68 65 69 67 68 74 | {. in|t height|
|000005a0| 2c 77 69 64 74 68 3b 0d | 20 20 20 68 65 69 67 68 |,width;.| heigh|
|000005b0| 74 20 3d 20 73 63 72 65 | 65 6e 42 69 74 73 2e 62 |t = scre|enBits.b|
|000005c0| 6f 75 6e 64 73 2e 62 6f | 74 74 6f 6d 20 2d 20 73 |ounds.bo|ttom - s|
|000005d0| 63 72 65 65 6e 42 69 74 | 73 2e 62 6f 75 6e 64 73 |creenBit|s.bounds|
|000005e0| 2e 74 6f 70 20 2d 20 32 | 30 3b 0d 20 20 20 77 69 |.top - 2|0;. wi|
|000005f0| 64 74 68 20 3d 20 73 63 | 72 65 65 6e 42 69 74 73 |dth = sc|reenBits|
|00000600| 2e 62 6f 75 6e 64 73 2e | 72 69 67 68 74 20 2d 20 |.bounds.|right - |
|00000610| 73 63 72 65 65 6e 42 69 | 74 73 2e 62 6f 75 6e 64 |screenBi|ts.bound|
|00000620| 73 2e 6c 65 66 74 3b 0d | 20 20 20 69 66 20 28 20 |s.left;.| if ( |
|00000630| 72 69 67 68 74 20 2d 20 | 6c 65 66 74 20 3c 3d 20 |right - |left <= |
|00000640| 30 20 7c 7c 20 72 69 67 | 68 74 20 2d 20 6c 65 66 |0 || rig|ht - lef|
|00000650| 74 20 3e 20 77 69 64 74 | 68 29 20 7b 0d 20 20 20 |t > widt|h) {. |
|00000660| 20 20 20 6c 65 66 74 20 | 3d 20 32 3b 0d 20 20 20 | left |= 2;. |
|00000670| 20 20 20 72 69 67 68 74 | 20 3d 20 73 63 72 65 65 | right| = scree|
|00000680| 6e 42 69 74 73 2e 62 6f | 75 6e 64 73 2e 72 69 67 |nBits.bo|unds.rig|
|00000690| 68 74 20 2d 20 32 3b 0d | 20 20 20 7d 3b 0d 20 20 |ht - 2;.| };. |
|000006a0| 20 69 66 20 28 20 62 6f | 74 74 6f 6d 20 2d 20 74 | if ( bo|ttom - t|
|000006b0| 6f 70 20 3c 3d 20 30 20 | 7c 7c 20 62 6f 74 74 6f |op <= 0 ||| botto|
|000006c0| 6d 20 2d 20 74 6f 70 20 | 3e 20 68 65 69 67 68 74 |m - top |> height|
|000006d0| 29 20 7b 0d 20 20 20 20 | 20 20 74 6f 70 20 3d 20 |) {. | top = |
|000006e0| 34 30 3b 0d 20 20 20 20 | 20 20 62 6f 74 74 6f 6d |40;. | bottom|
|000006f0| 20 3d 20 73 63 72 65 65 | 6e 42 69 74 73 2e 62 6f | = scree|nBits.bo|
|00000700| 75 6e 64 73 2e 62 6f 74 | 74 6f 6d 20 2d 20 32 3b |unds.bot|tom - 2;|
|00000710| 0d 20 20 20 7d 3b 0d 20 | 20 20 53 65 74 44 65 66 |. };. | SetDef|
|00000720| 61 75 6c 74 73 28 29 3b | 0d 20 20 20 64 6f 42 61 |aults();|. doBa|
|00000730| 73 69 63 4f 70 65 6e 28 | 74 69 74 6c 65 2c 6c 65 |sicOpen(|title,le|
|00000740| 66 74 2c 74 6f 70 2c 72 | 69 67 68 74 2c 62 6f 74 |ft,top,r|ight,bot|
|00000750| 74 6f 6d 29 3b 0d 7d 0d | 0d 76 6f 69 64 20 78 57 |tom);.}.|.void xW|
|00000760| 69 6e 64 6f 77 3a 3a 4f | 70 65 6e 46 75 6c 6c 53 |indow::O|penFullS|
|00000770| 63 72 65 65 6e 28 53 74 | 72 32 35 35 20 74 69 74 |creen(St|r255 tit|
|00000780| 6c 65 29 20 7b 0d 20 20 | 20 52 65 63 74 20 52 3b |le) {. | Rect R;|
|00000790| 0d 20 20 20 52 20 3d 20 | 73 63 72 65 65 6e 42 69 |. R = |screenBi|
|000007a0| 74 73 2e 62 6f 75 6e 64 | 73 3b 0d 20 20 20 52 2e |ts.bound|s;. R.|
|000007b0| 74 6f 70 20 3d 20 33 36 | 3b 0d 20 20 20 49 6e 73 |top = 36|;. Ins|
|000007c0| 65 74 52 65 63 74 28 26 | 52 2c 34 2c 34 29 3b 0d |etRect(&|R,4,4);.|
|000007d0| 20 20 20 4f 70 65 6e 49 | 6e 52 65 63 74 28 74 69 | OpenI|nRect(ti|
|000007e0| 74 6c 65 2c 52 2e 6c 65 | 66 74 2c 52 2e 74 6f 70 |tle,R.le|ft,R.top|
|000007f0| 2c 52 2e 72 69 67 68 74 | 2c 52 2e 62 6f 74 74 6f |,R.right|,R.botto|
|00000800| 6d 29 3b 0d 7d 0d 0d 76 | 6f 69 64 20 78 57 69 6e |m);.}..v|oid xWin|
|00000810| 64 6f 77 3a 3a 4f 70 65 | 6e 28 53 74 72 32 35 35 |dow::Ope|n(Str255|
|00000820| 20 74 69 74 6c 65 29 20 | 7b 0d 20 20 20 69 66 20 | title) |{. if |
|00000830| 28 67 57 69 6e 64 6f 77 | 52 65 63 74 2e 62 6f 74 |(gWindow|Rect.bot|
|00000840| 74 6f 6d 20 3c 3d 20 67 | 57 69 6e 64 6f 77 52 65 |tom <= g|WindowRe|
|00000850| 63 74 2e 74 6f 70 29 20 | 7b 0d 20 20 20 20 20 20 |ct.top) |{. |
|00000860| 67 57 69 6e 64 6f 77 52 | 65 63 74 20 3d 20 73 63 |gWindowR|ect = sc|
|00000870| 72 65 65 6e 42 69 74 73 | 2e 62 6f 75 6e 64 73 3b |reenBits|.bounds;|
|00000880| 0d 20 20 20 20 20 20 67 | 57 69 6e 64 6f 77 52 65 |. g|WindowRe|
|00000890| 63 74 2e 74 6f 70 20 2b | 3d 20 34 32 3b 0d 20 20 |ct.top +|= 42;. |
|000008a0| 20 20 20 20 67 57 69 6e | 64 6f 77 52 65 63 74 2e | gWin|dowRect.|
|000008b0| 6c 65 66 74 20 2b 3d 20 | 34 3b 0d 20 20 20 20 20 |left += |4;. |
|000008c0| 20 67 57 69 6e 64 6f 77 | 52 65 63 74 2e 72 69 67 | gWindow|Rect.rig|
|000008d0| 68 74 20 3d 20 67 57 69 | 6e 64 6f 77 52 65 63 74 |ht = gWi|ndowRect|
|000008e0| 2e 6c 65 66 74 20 2b 20 | 33 2a 28 67 57 69 6e 64 |.left + |3*(gWind|
|000008f0| 6f 77 52 65 63 74 2e 72 | 69 67 68 74 2d 67 57 69 |owRect.r|ight-gWi|
|00000900| 6e 64 6f 77 52 65 63 74 | 2e 6c 65 66 74 29 2f 34 |ndowRect|.left)/4|
|00000910| 3b 0d 20 20 20 20 20 20 | 67 57 69 6e 64 6f 77 52 |;. |gWindowR|
|00000920| 65 63 74 2e 62 6f 74 74 | 6f 6d 20 3d 20 67 57 69 |ect.bott|om = gWi|
|00000930| 6e 64 6f 77 52 65 63 74 | 2e 74 6f 70 20 2b 20 33 |ndowRect|.top + 3|
|00000940| 2a 28 67 57 69 6e 64 6f | 77 52 65 63 74 2e 62 6f |*(gWindo|wRect.bo|
|00000950| 74 74 6f 6d 2d 67 57 69 | 6e 64 6f 77 52 65 63 74 |ttom-gWi|ndowRect|
|00000960| 2e 74 6f 70 29 2f 34 3b | 20 20 20 0d 20 20 20 7d |.top)/4;| . }|
|00000970| 3b 0d 20 20 20 69 66 20 | 28 67 57 69 6e 64 6f 77 |;. if |(gWindow|
|00000980| 52 65 63 74 2e 62 6f 74 | 74 6f 6d 20 3e 20 73 63 |Rect.bot|tom > sc|
|00000990| 72 65 65 6e 42 69 74 73 | 2e 62 6f 75 6e 64 73 2e |reenBits|.bounds.|
|000009a0| 62 6f 74 74 6f 6d 29 0d | 20 20 20 20 20 20 4f 66 |bottom).| Of|
|000009b0| 66 73 65 74 52 65 63 74 | 28 26 67 57 69 6e 64 6f |fsetRect|(&gWindo|
|000009c0| 77 52 65 63 74 2c 30 2c | 34 30 20 2d 20 67 57 69 |wRect,0,|40 - gWi|
|000009d0| 6e 64 6f 77 52 65 63 74 | 2e 74 6f 70 29 3b 0d 20 |ndowRect|.top);. |
|000009e0| 20 20 69 66 20 28 67 57 | 69 6e 64 6f 77 52 65 63 | if (gW|indowRec|
|000009f0| 74 2e 72 69 67 68 74 20 | 3e 20 73 63 72 65 65 6e |t.right |> screen|
|00000a00| 42 69 74 73 2e 62 6f 75 | 6e 64 73 2e 72 69 67 68 |Bits.bou|nds.righ|
|00000a10| 74 29 0d 20 20 20 20 20 | 20 4f 66 66 73 65 74 52 |t). | OffsetR|
|00000a20| 65 63 74 28 26 67 57 69 | 6e 64 6f 77 52 65 63 74 |ect(&gWi|ndowRect|
|00000a30| 2c 34 20 2d 20 67 57 69 | 6e 64 6f 77 52 65 63 74 |,4 - gWi|ndowRect|
|00000a40| 2e 6c 65 66 74 2c 20 30 | 29 3b 0d 20 20 20 4f 70 |.left, 0|);. Op|
|00000a50| 65 6e 49 6e 52 65 63 74 | 28 74 69 74 6c 65 2c 67 |enInRect|(title,g|
|00000a60| 57 69 6e 64 6f 77 52 65 | 63 74 2e 6c 65 66 74 2c |WindowRe|ct.left,|
|00000a70| 67 57 69 6e 64 6f 77 52 | 65 63 74 2e 74 6f 70 2c |gWindowR|ect.top,|
|00000a80| 67 57 69 6e 64 6f 77 52 | 65 63 74 2e 72 69 67 68 |gWindowR|ect.righ|
|00000a90| 74 2c 67 57 69 6e 64 6f | 77 52 65 63 74 2e 62 6f |t,gWindo|wRect.bo|
|00000aa0| 74 74 6f 6d 29 3b 0d 20 | 20 20 4f 66 66 73 65 74 |ttom);. | Offset|
|00000ab0| 52 65 63 74 28 26 67 57 | 69 6e 64 6f 77 52 65 63 |Rect(&gW|indowRec|
|00000ac0| 74 2c 32 30 2c 32 30 29 | 3b 20 20 20 0d 7d 0d 0d |t,20,20)|; .}..|
|00000ad0| 0d 76 6f 69 64 20 78 57 | 69 6e 64 6f 77 3a 3a 64 |.void xW|indow::d|
|00000ae0| 6f 42 61 73 69 63 4f 70 | 65 6e 28 53 74 72 32 35 |oBasicOp|en(Str25|
|00000af0| 35 20 74 69 74 6c 65 2c | 20 69 6e 74 20 6c 65 66 |5 title,| int lef|
|00000b00| 74 2c 20 69 6e 74 20 74 | 6f 70 2c 20 69 6e 74 20 |t, int t|op, int |
|00000b10| 72 69 67 68 74 2c 20 69 | 6e 74 20 62 6f 74 74 6f |right, i|nt botto|
|00000b20| 6d 29 20 7b 0d 20 20 20 | 52 65 63 74 20 62 6f 75 |m) {. |Rect bou|
|00000b30| 6e 64 73 3b 0d 20 20 20 | 73 68 6f 72 74 20 70 72 |nds;. |short pr|
|00000b40| 6f 63 49 44 3b 0d 20 20 | 20 57 69 6e 64 6f 77 50 |ocID;. | WindowP|
|00000b50| 74 72 20 77 69 6e 3b 0d | 20 20 20 6e 65 78 74 57 |tr win;.| nextW|
|00000b60| 69 6e 64 6f 77 20 3d 20 | 78 57 69 6e 64 6f 77 4c |indow = |xWindowL|
|00000b70| 69 73 74 3b 0d 20 20 20 | 78 57 69 6e 64 6f 77 4c |ist;. |xWindowL|
|00000b80| 69 73 74 20 3d 20 74 68 | 69 73 3b 0d 20 20 20 53 |ist = th|is;. S|
|00000b90| 65 74 52 65 63 74 28 26 | 62 6f 75 6e 64 73 2c 6c |etRect(&|bounds,l|
|00000ba0| 65 66 74 2c 74 6f 70 2c | 72 69 67 68 74 2c 62 6f |eft,top,|right,bo|
|00000bb0| 74 74 6f 6d 29 3b 0d 20 | 20 20 69 66 20 28 66 65 |ttom);. | if (fe|
|00000bc0| 61 74 75 72 65 73 20 26 | 20 68 61 73 47 72 6f 77 |atures &| hasGrow|
|00000bd0| 29 0d 20 20 20 20 20 20 | 70 72 6f 63 49 44 20 3d |). |procID =|
|00000be0| 20 64 6f 63 75 6d 65 6e | 74 50 72 6f 63 3b 0d 20 | documen|tProc;. |
|00000bf0| 20 20 65 6c 73 65 0d 20 | 20 20 20 20 20 70 72 6f | else. | pro|
|00000c00| 63 49 44 20 3d 20 6e 6f | 47 72 6f 77 44 6f 63 50 |cID = no|GrowDocP|
|00000c10| 72 6f 63 3b 0d 20 20 20 | 69 66 20 28 66 65 61 74 |roc;. |if (feat|
|00000c20| 75 72 65 73 20 26 20 68 | 61 73 5a 6f 6f 6d 29 0d |ures & h|asZoom).|
|00000c30| 20 20 20 20 20 20 70 72 | 6f 63 49 44 20 2b 3d 20 | pr|ocID += |
|00000c40| 38 3b 0d 20 20 20 74 68 | 65 57 69 6e 64 6f 77 20 |8;. th|eWindow |
|00000c50| 3d 20 4e 65 77 57 69 6e | 64 6f 77 28 20 28 50 74 |= NewWin|dow( (Pt|
|00000c60| 72 29 20 30 2c 20 26 62 | 6f 75 6e 64 73 2c 20 74 |r) 0, &b|ounds, t|
|00000c70| 69 74 6c 65 2c 20 74 72 | 75 65 2c 20 70 72 6f 63 |itle, tr|ue, proc|
|00000c80| 49 44 2c 20 28 57 69 6e | 64 6f 77 50 74 72 29 20 |ID, (Win|dowPtr) |
|00000c90| 2d 31 2c 20 66 65 61 74 | 75 72 65 73 20 26 20 68 |-1, feat|ures & h|
|00000ca0| 61 73 47 6f 41 77 61 79 | 2c 20 30 29 3b 0d 20 20 |asGoAway|, 0);. |
|00000cb0| 20 77 69 6e 20 3d 20 74 | 68 65 57 69 6e 64 6f 77 | win = t|heWindow|
|00000cc0| 3b 0d 20 20 20 69 66 20 | 28 66 65 61 74 75 72 65 |;. if |(feature|
|00000cd0| 73 20 26 20 68 61 73 48 | 53 63 72 6f 6c 6c 29 20 |s & hasH|Scroll) |
|00000ce0| 7b 0d 20 20 20 20 20 20 | 53 65 74 52 65 63 74 28 |{. |SetRect(|
|00000cf0| 26 62 6f 75 6e 64 73 2c | 30 2c 30 2c 31 2c 31 29 |&bounds,|0,0,1,1)|
|00000d00| 3b 0d 20 20 20 20 20 20 | 68 53 63 72 6f 6c 6c 20 |;. |hScroll |
|00000d10| 3d 20 4e 65 77 43 6f 6e | 74 72 6f 6c 28 77 69 6e |= NewCon|trol(win|
|00000d20| 2c 26 62 6f 75 6e 64 73 | 2c 22 22 2c 30 2c 30 2c |,&bounds|,"",0,0,|
|00000d30| 30 2c 30 2c 73 63 72 6f | 6c 6c 42 61 72 50 72 6f |0,0,scro|llBarPro|
|00000d40| 63 2c 28 6c 6f 6e 67 29 | 20 74 68 69 73 29 3b 0d |c,(long)| this);.|
|00000d50| 20 20 20 7d 3b 0d 20 20 | 20 69 66 20 28 66 65 61 | };. | if (fea|
|00000d60| 74 75 72 65 73 20 26 20 | 68 61 73 56 53 63 72 6f |tures & |hasVScro|
|00000d70| 6c 6c 29 20 7b 0d 20 20 | 20 20 20 20 53 65 74 52 |ll) {. | SetR|
|00000d80| 65 63 74 28 26 62 6f 75 | 6e 64 73 2c 30 2c 30 2c |ect(&bou|nds,0,0,|
|00000d90| 31 2c 31 29 3b 0d 20 20 | 20 20 20 20 76 53 63 72 |1,1);. | vScr|
|00000da0| 6f 6c 6c 20 3d 20 4e 65 | 77 43 6f 6e 74 72 6f 6c |oll = Ne|wControl|
|00000db0| 28 77 69 6e 2c 26 62 6f | 75 6e 64 73 2c 22 22 2c |(win,&bo|unds,"",|
|00000dc0| 30 2c 30 2c 30 2c 30 2c | 73 63 72 6f 6c 6c 42 61 |0,0,0,0,|scrollBa|
|00000dd0| 72 50 72 6f 63 2c 28 6c | 6f 6e 67 29 20 74 68 69 |rProc,(l|ong) thi|
|00000de0| 73 29 3b 20 0d 20 20 20 | 7d 3b 0d 20 20 20 61 64 |s); . |};. ad|
|00000df0| 6a 75 73 74 54 6f 4e 65 | 77 53 69 7a 65 28 29 3b |justToNe|wSize();|
|00000e00| 0d 7d 0d 0d 0d 78 57 69 | 6e 64 6f 77 3a 3a 7e 78 |.}...xWi|ndow::~x|
|00000e10| 57 69 6e 64 6f 77 28 76 | 6f 69 64 29 20 7b 0d 0d |Window(v|oid) {..|
|00000e20| 7d 0d 0d 73 68 6f 72 74 | 20 78 57 69 6e 64 6f 77 |}..short| xWindow|
|00000e30| 3a 3a 43 6c 6f 73 65 28 | 76 6f 69 64 29 20 7b 0d |::Close(|void) {.|
|00000e40| 20 20 20 78 57 69 6e 64 | 6f 77 20 2a 72 75 6e 3b | xWind|ow *run;|
|00000e50| 0d 20 20 20 72 75 6e 20 | 3d 20 78 57 69 6e 64 6f |. run |= xWindo|
|00000e60| 77 4c 69 73 74 3b 0d 20 | 20 20 69 66 20 28 72 75 |wList;. | if (ru|
|00000e70| 6e 20 3d 3d 20 74 68 69 | 73 29 20 7b 0d 20 20 20 |n == thi|s) {. |
|00000e80| 20 20 20 78 57 69 6e 64 | 6f 77 4c 69 73 74 20 3d | xWind|owList =|
|00000e90| 20 78 57 69 6e 64 6f 77 | 4c 69 73 74 2d 3e 6e 65 | xWindow|List->ne|
|00000ea0| 78 74 57 69 6e 64 6f 77 | 3b 0d 20 20 20 7d 20 65 |xtWindow|;. } e|
|00000eb0| 6c 73 65 20 7b 0d 20 20 | 20 20 20 20 77 68 69 6c |lse {. | whil|
|00000ec0| 65 20 28 20 72 75 6e 20 | 26 26 20 72 75 6e 2d 3e |e ( run |&& run->|
|00000ed0| 6e 65 78 74 57 69 6e 64 | 6f 77 20 21 3d 20 74 68 |nextWind|ow != th|
|00000ee0| 69 73 20 29 20 7b 0d 20 | 20 20 20 20 20 20 20 20 |is ) {. | |
|00000ef0| 20 72 75 6e 20 3d 20 72 | 75 6e 2d 3e 6e 65 78 74 | run = r|un->next|
|00000f00| 57 69 6e 64 6f 77 3b 20 | 20 0d 20 20 20 20 20 20 |Window; | . |
|00000f10| 7d 3b 0d 20 20 20 20 20 | 20 69 66 20 28 72 75 6e |};. | if (run|
|00000f20| 29 20 7b 0d 20 20 20 20 | 20 20 20 20 20 20 72 75 |) {. | ru|
|00000f30| 6e 2d 3e 6e 65 78 74 57 | 69 6e 64 6f 77 20 3d 20 |n->nextW|indow = |
|00000f40| 72 75 6e 2d 3e 6e 65 78 | 74 57 69 6e 64 6f 77 2d |run->nex|tWindow-|
|00000f50| 3e 6e 65 78 74 57 69 6e | 64 6f 77 3b 0d 20 20 20 |>nextWin|dow;. |
|00000f60| 20 20 20 7d 3b 0d 20 20 | 20 7d 3b 0d 20 20 20 44 | };. | };. D|
|00000f70| 69 73 70 6f 73 65 57 69 | 6e 64 6f 77 28 74 68 65 |isposeWi|ndow(the|
|00000f80| 57 69 6e 64 6f 77 29 3b | 0d 20 20 20 64 65 6c 65 |Window);|. dele|
|00000f90| 74 65 20 74 68 69 73 3b | 0d 20 20 20 72 65 74 75 |te this;|. retu|
|00000fa0| 72 6e 20 31 3b 0d 7d 0d | 0d 0d 0d 76 6f 69 64 20 |rn 1;.}.|...void |
|00000fb0| 78 57 69 6e 64 6f 77 3a | 3a 64 6f 43 6f 6e 74 65 |xWindow:|:doConte|
|00000fc0| 6e 74 43 6c 69 63 6b 28 | 50 6f 69 6e 74 20 6c 6f |ntClick(|Point lo|
|00000fd0| 63 61 6c 50 74 29 20 7b | 0d 20 20 20 20 2f 2a 20 |calPt) {|. /* |
|00000fe0| 44 65 66 61 75 6c 74 20 | 61 63 74 69 6f 6e 20 69 |Default |action i|
|00000ff0| 73 20 74 6f 20 64 6f 20 | 6e 6f 74 68 69 6e 67 20 |s to do |nothing |
|00001000| 2a 2f 0d 7d 0d 0d 76 6f | 69 64 20 78 57 69 6e 64 |*/.}..vo|id xWind|
|00001010| 6f 77 3a 3a 64 6f 4b 65 | 79 28 63 68 61 72 20 63 |ow::doKe|y(char c|
|00001020| 68 29 20 7b 0d 20 20 20 | 20 2f 2a 20 44 65 66 61 |h) {. | /* Defa|
|00001030| 75 6c 74 20 61 63 74 69 | 6f 6e 20 69 73 20 74 6f |ult acti|on is to|
|00001040| 20 64 6f 20 6e 6f 74 68 | 69 6e 67 20 2a 2f 0d 7d | do noth|ing */.}|
|00001050| 0d 0d 76 6f 69 64 20 78 | 57 69 6e 64 6f 77 3a 3a |..void x|Window::|
|00001060| 64 6f 48 53 63 72 6f 6c | 6c 28 69 6e 74 20 64 68 |doHScrol|l(int dh|
|00001070| 29 20 7b 0d 20 20 20 2f | 2a 20 44 65 66 61 75 6c |) {. /|* Defaul|
|00001080| 74 20 61 63 74 69 6f 6e | 20 69 73 20 74 6f 20 65 |t action| is to e|
|00001090| 72 61 73 65 20 61 6e 64 | 20 72 65 64 72 61 77 20 |rase and| redraw |
|000010a0| 2a 2f 0d 20 20 20 47 72 | 61 66 50 74 72 20 73 61 |*/. Gr|afPtr sa|
|000010b0| 76 65 50 6f 72 74 3b 0d | 20 20 20 52 65 63 74 20 |vePort;.| Rect |
|000010c0| 62 61 64 52 65 63 74 3b | 0d 20 20 20 47 65 74 50 |badRect;|. GetP|
|000010d0| 6f 72 74 28 26 73 61 76 | 65 50 6f 72 74 29 3b 0d |ort(&sav|ePort);.|
|000010e0| 20 20 20 53 65 74 50 6f | 72 74 28 74 68 65 57 69 | SetPo|rt(theWi|
|000010f0| 6e 64 6f 77 29 3b 0d 20 | 20 20 62 61 64 52 65 63 |ndow);. | badRec|
|00001100| 74 20 3d 20 74 68 65 57 | 69 6e 64 6f 77 2d 3e 70 |t = theW|indow->p|
|00001110| 6f 72 74 52 65 63 74 3b | 0d 20 20 20 69 66 20 28 |ortRect;|. if (|
|00001120| 20 66 65 61 74 75 72 65 | 73 20 26 20 68 61 73 48 | feature|s & hasH|
|00001130| 53 63 72 6f 6c 6c 20 29 | 0d 20 20 20 20 20 20 62 |Scroll )|. b|
|00001140| 61 64 52 65 63 74 2e 62 | 6f 74 74 6f 6d 20 2d 3d |adRect.b|ottom -=|
|00001150| 20 31 35 3b 0d 20 20 20 | 69 66 20 28 20 66 65 61 | 15;. |if ( fea|
|00001160| 74 75 72 65 73 20 26 20 | 68 61 73 56 53 63 72 6f |tures & |hasVScro|
|00001170| 6c 6c 20 29 0d 20 20 20 | 20 20 20 62 61 64 52 65 |ll ). | badRe|
|00001180| 63 74 2e 72 69 67 68 74 | 20 2d 3d 20 31 35 3b 0d |ct.right| -= 15;.|
|00001190| 20 20 20 45 72 61 73 65 | 52 65 63 74 28 26 62 61 | Erase|Rect(&ba|
|000011a0| 64 52 65 63 74 29 3b 0d | 20 20 20 64 6f 52 65 64 |dRect);.| doRed|
|000011b0| 72 61 77 28 26 62 61 64 | 52 65 63 74 29 3b 0d 20 |raw(&bad|Rect);. |
|000011c0| 20 20 53 65 74 50 6f 72 | 74 28 73 61 76 65 50 6f | SetPor|t(savePo|
|000011d0| 72 74 29 3b 0d 7d 0d 0d | 76 6f 69 64 20 78 57 69 |rt);.}..|void xWi|
|000011e0| 6e 64 6f 77 3a 3a 64 6f | 56 53 63 72 6f 6c 6c 28 |ndow::do|VScroll(|
|000011f0| 69 6e 74 20 64 76 29 20 | 7b 0d 20 20 20 2f 2a 20 |int dv) |{. /* |
|00001200| 44 65 66 61 75 6c 74 20 | 61 63 74 69 6f 6e 20 69 |Default |action i|
|00001210| 73 20 74 6f 20 65 72 61 | 73 65 20 61 6e 64 20 72 |s to era|se and r|
|00001220| 65 64 72 61 77 20 2a 2f | 0d 20 20 20 47 72 61 66 |edraw */|. Graf|
|00001230| 50 74 72 20 73 61 76 65 | 50 6f 72 74 3b 0d 20 20 |Ptr save|Port;. |
|00001240| 20 52 65 63 74 20 62 61 | 64 52 65 63 74 3b 0d 20 | Rect ba|dRect;. |
|00001250| 20 20 47 65 74 50 6f 72 | 74 28 26 73 61 76 65 50 | GetPor|t(&saveP|
|00001260| 6f 72 74 29 3b 0d 20 20 | 20 53 65 74 50 6f 72 74 |ort);. | SetPort|
|00001270| 28 74 68 65 57 69 6e 64 | 6f 77 29 3b 0d 20 20 20 |(theWind|ow);. |
|00001280| 62 61 64 52 65 63 74 20 | 3d 20 74 68 65 57 69 6e |badRect |= theWin|
|00001290| 64 6f 77 2d 3e 70 6f 72 | 74 52 65 63 74 3b 0d 20 |dow->por|tRect;. |
|000012a0| 20 20 69 66 20 28 20 66 | 65 61 74 75 72 65 73 20 | if ( f|eatures |
|000012b0| 26 20 68 61 73 48 53 63 | 72 6f 6c 6c 20 29 0d 20 |& hasHSc|roll ). |
|000012c0| 20 20 20 20 20 62 61 64 | 52 65 63 74 2e 62 6f 74 | bad|Rect.bot|
|000012d0| 74 6f 6d 20 2d 3d 20 31 | 35 3b 0d 20 20 20 69 66 |tom -= 1|5;. if|
|000012e0| 20 28 20 66 65 61 74 75 | 72 65 73 20 26 20 68 61 | ( featu|res & ha|
|000012f0| 73 56 53 63 72 6f 6c 6c | 20 29 0d 20 20 20 20 20 |sVScroll| ). |
|00001300| 20 62 61 64 52 65 63 74 | 2e 72 69 67 68 74 20 2d | badRect|.right -|
|00001310| 3d 20 31 35 3b 0d 20 20 | 20 45 72 61 73 65 52 65 |= 15;. | EraseRe|
|00001320| 63 74 28 26 62 61 64 52 | 65 63 74 29 3b 0d 20 20 |ct(&badR|ect);. |
|00001330| 20 64 6f 52 65 64 72 61 | 77 28 26 62 61 64 52 65 | doRedra|w(&badRe|
|00001340| 63 74 29 3b 0d 20 20 20 | 53 65 74 50 6f 72 74 28 |ct);. |SetPort(|
|00001350| 73 61 76 65 50 6f 72 74 | 29 3b 0d 7d 0d 0d 76 6f |savePort|);.}..vo|
|00001360| 69 64 20 78 57 69 6e 64 | 6f 77 3a 3a 64 6f 52 65 |id xWind|ow::doRe|
|00001370| 64 72 61 77 28 52 65 63 | 74 2a 20 62 61 64 52 65 |draw(Rec|t* badRe|
|00001380| 63 74 29 20 7b 0d 20 20 | 20 2f 2a 20 64 65 66 61 |ct) {. | /* defa|
|00001390| 75 6c 74 20 6d 65 74 68 | 6f 64 20 64 6f 65 73 20 |ult meth|od does |
|000013a0| 6e 6f 74 68 69 6e 67 20 | 2a 2f 0d 7d 0d 0d 0d 76 |nothing |*/.}...v|
|000013b0| 6f 69 64 20 78 57 69 6e | 64 6f 77 3a 3a 64 6f 45 |oid xWin|dow::doE|
|000013c0| 76 65 6e 74 28 76 6f 69 | 64 29 20 7b 0d 20 20 20 |vent(voi|d) {. |
|000013d0| 47 72 61 66 50 74 72 20 | 73 61 76 65 50 6f 72 74 |GrafPtr |savePort|
|000013e0| 3b 0d 20 20 20 73 77 69 | 74 63 68 20 28 67 45 76 |;. swi|tch (gEv|
|000013f0| 65 6e 74 2e 77 68 61 74 | 29 20 7b 0d 20 20 20 20 |ent.what|) {. |
|00001400| 20 63 61 73 65 20 61 75 | 74 6f 4b 65 79 3a 0d 20 | case au|toKey:. |
|00001410| 20 20 20 20 63 61 73 65 | 20 6b 65 79 44 6f 77 6e | case| keyDown|
|00001420| 3a 20 7b 0d 20 20 20 20 | 20 20 20 47 65 74 50 6f |: {. | GetPo|
|00001430| 72 74 28 26 73 61 76 65 | 50 6f 72 74 29 3b 0d 20 |rt(&save|Port);. |
|00001440| 20 20 20 20 20 20 53 65 | 74 50 6f 72 74 28 74 68 | Se|tPort(th|
|00001450| 65 57 69 6e 64 6f 77 29 | 3b 0d 20 20 20 20 20 20 |eWindow)|;. |
|00001460| 20 64 6f 4b 65 79 28 67 | 45 76 65 6e 74 2e 6d 65 | doKey(g|Event.me|
|00001470| 73 73 61 67 65 20 26 20 | 30 78 46 46 29 3b 0d 20 |ssage & |0xFF);. |
|00001480| 20 20 20 20 20 20 53 65 | 74 50 6f 72 74 28 73 61 | Se|tPort(sa|
|00001490| 76 65 50 6f 72 74 29 3b | 0d 20 20 20 20 20 20 20 |vePort);|. |
|000014a0| 62 72 65 61 6b 3b 20 0d | 20 20 20 20 20 7d 0d 20 |break; .| }. |
|000014b0| 20 20 20 20 63 61 73 65 | 20 6d 6f 75 73 65 44 6f | case| mouseDo|
|000014c0| 77 6e 3a 20 7b 0d 20 20 | 20 20 20 20 20 64 6f 43 |wn: {. | doC|
|000014d0| 6c 69 63 6b 28 67 45 76 | 65 6e 74 2e 77 68 65 72 |lick(gEv|ent.wher|
|000014e0| 65 29 3b 0d 20 20 20 20 | 20 20 20 62 72 65 61 6b |e);. | break|
|000014f0| 3b 0d 20 20 20 20 20 7d | 0d 20 20 20 20 20 63 61 |;. }|. ca|
|00001500| 73 65 20 61 63 74 69 76 | 61 74 65 45 76 74 3a 20 |se activ|ateEvt: |
|00001510| 7b 0d 20 20 20 20 20 20 | 20 64 6f 41 63 74 69 76 |{. | doActiv|
|00001520| 61 74 65 28 67 45 76 65 | 6e 74 2e 6d 6f 64 69 66 |ate(gEve|nt.modif|
|00001530| 69 65 72 73 20 26 20 61 | 63 74 69 76 65 46 6c 61 |iers & a|ctiveFla|
|00001540| 67 29 3b 0d 20 20 20 20 | 20 20 20 62 72 65 61 6b |g);. | break|
|00001550| 3b 0d 20 20 20 20 20 7d | 0d 20 20 20 20 20 63 61 |;. }|. ca|
|00001560| 73 65 20 75 70 64 61 74 | 65 45 76 74 3a 20 7b 0d |se updat|eEvt: {.|
|00001570| 20 20 20 20 20 20 20 64 | 6f 55 70 64 61 74 65 28 | d|oUpdate(|
|00001580| 29 3b 0d 20 20 20 20 20 | 7d 0d 20 20 20 7d 0d 7d |);. |}. }.}|
|00001590| 0d 0d 2f 2a 20 47 6c 6f | 62 61 6c 20 44 61 74 61 |../* Glo|bal Data|
|000015a0| 20 66 6f 72 20 63 6f 6d | 6d 75 6e 69 63 61 74 69 | for com|municati|
|000015b0| 6f 6e 20 6f 66 20 64 6f | 43 6c 69 63 6b 20 77 69 |on of do|Click wi|
|000015c0| 74 68 20 43 6f 6e 74 69 | 6e 75 6f 75 73 53 63 72 |th Conti|nuousScr|
|000015d0| 6f 6c 6c 20 2a 2f 0d 0d | 73 74 61 74 69 63 20 78 |oll */..|static x|
|000015e0| 57 69 6e 64 6f 77 20 2a | 73 63 72 6f 6c 6c 69 6e |Window *|scrollin|
|000015f0| 67 57 69 6e 3b 0d 0d 70 | 61 73 63 61 6c 20 76 6f |gWin;..p|ascal vo|
|00001600| 69 64 20 78 57 69 6e 64 | 6f 77 3a 3a 43 6f 6e 74 |id xWind|ow::Cont|
|00001610| 69 6e 75 6f 75 73 53 63 | 72 6f 6c 6c 28 43 6f 6e |inuousSc|roll(Con|
|00001620| 74 72 6f 6c 48 61 6e 64 | 6c 65 20 74 68 65 43 6f |trolHand|le theCo|
|00001630| 6e 74 72 6f 6c 2c 20 73 | 68 6f 72 74 20 70 61 72 |ntrol, s|hort par|
|00001640| 74 4e 75 6d 29 20 7b 0d | 20 20 20 73 68 6f 72 74 |tNum) {.| short|
|00001650| 20 63 68 61 6e 67 65 3b | 0d 20 20 20 73 68 6f 72 | change;|. shor|
|00001660| 74 20 6f 6c 64 56 61 6c | 2c 20 6d 61 78 3b 0d 20 |t oldVal|, max;. |
|00001670| 20 20 73 68 6f 72 74 20 | 73 63 72 6f 6c 6c 4c 69 | short |scrollLi|
|00001680| 6e 65 73 50 65 72 50 61 | 67 65 3b 0d 20 20 20 73 |nesPerPa|ge;. s|
|00001690| 68 6f 72 74 20 73 63 72 | 6f 6c 6c 69 6e 67 48 6f |hort scr|ollingHo|
|000016a0| 72 69 7a 6f 6e 74 61 6c | 6c 79 3b 0d 20 20 20 69 |rizontal|ly;. i|
|000016b0| 66 20 28 20 74 68 65 43 | 6f 6e 74 72 6f 6c 20 3d |f ( theC|ontrol =|
|000016c0| 3d 20 73 63 72 6f 6c 6c | 69 6e 67 57 69 6e 2d 3e |= scroll|ingWin->|
|000016d0| 68 53 63 72 6f 6c 6c 20 | 29 20 7b 0d 20 20 20 20 |hScroll |) {. |
|000016e0| 20 20 73 63 72 6f 6c 6c | 69 6e 67 48 6f 72 69 7a | scroll|ingHoriz|
|000016f0| 6f 6e 74 61 6c 6c 79 20 | 3d 20 31 3b 0d 20 20 20 |ontally |= 1;. |
|00001700| 20 20 20 73 63 72 6f 6c | 6c 4c 69 6e 65 73 50 65 | scrol|lLinesPe|
|00001710| 72 50 61 67 65 20 3d 20 | 73 63 72 6f 6c 6c 69 6e |rPage = |scrollin|
|00001720| 67 57 69 6e 2d 3e 68 4c | 69 6e 65 73 50 65 72 50 |gWin->hL|inesPerP|
|00001730| 61 67 65 3b 0d 20 20 20 | 7d 0d 20 20 20 65 6c 73 |age;. |}. els|
|00001740| 65 20 7b 0d 20 20 20 20 | 20 20 73 63 72 6f 6c 6c |e {. | scroll|
|00001750| 69 6e 67 48 6f 72 69 7a | 6f 6e 74 61 6c 6c 79 20 |ingHoriz|ontally |
|00001760| 3d 20 30 3b 0d 20 20 20 | 20 20 20 73 63 72 6f 6c |= 0;. | scrol|
|00001770| 6c 4c 69 6e 65 73 50 65 | 72 50 61 67 65 20 3d 20 |lLinesPe|rPage = |
|00001780| 73 63 72 6f 6c 6c 69 6e | 67 57 69 6e 2d 3e 76 4c |scrollin|gWin->vL|
|00001790| 69 6e 65 73 50 65 72 50 | 61 67 65 3b 0d 20 20 20 |inesPerP|age;. |
|000017a0| 7d 3b 0d 20 20 20 6f 6c | 64 56 61 6c 20 3d 20 47 |};. ol|dVal = G|
|000017b0| 65 74 43 74 6c 56 61 6c | 75 65 28 74 68 65 43 6f |etCtlVal|ue(theCo|
|000017c0| 6e 74 72 6f 6c 29 3b 0d | 20 20 20 6d 61 78 20 3d |ntrol);.| max =|
|000017d0| 20 47 65 74 43 74 6c 4d | 61 78 28 74 68 65 43 6f | GetCtlM|ax(theCo|
|000017e0| 6e 74 72 6f 6c 29 3b 0d | 20 20 20 63 68 61 6e 67 |ntrol);.| chang|
|000017f0| 65 20 3d 20 30 3b 0d 20 | 20 20 69 66 20 28 70 61 |e = 0;. | if (pa|
|00001800| 72 74 4e 75 6d 20 3d 3d | 20 69 6e 44 6f 77 6e 42 |rtNum ==| inDownB|
|00001810| 75 74 74 6f 6e 29 20 7b | 0d 20 20 20 20 20 20 69 |utton) {|. i|
|00001820| 66 20 28 6f 6c 64 56 61 | 6c 20 3c 20 6d 61 78 29 |f (oldVa|l < max)|
|00001830| 0d 20 20 20 20 20 20 20 | 20 20 63 68 61 6e 67 65 |. | change|
|00001840| 20 3d 20 31 3b 0d 20 20 | 20 7d 0d 20 20 20 65 6c | = 1;. | }. el|
|00001850| 73 65 20 69 66 20 28 70 | 61 72 74 4e 75 6d 20 3d |se if (p|artNum =|
|00001860| 3d 20 69 6e 55 70 42 75 | 74 74 6f 6e 29 20 7b 0d |= inUpBu|tton) {.|
|00001870| 20 20 20 20 20 20 69 66 | 20 28 6f 6c 64 56 61 6c | if| (oldVal|
|00001880| 20 3e 20 30 29 0d 20 20 | 20 20 20 20 20 20 20 63 | > 0). | c|
|00001890| 68 61 6e 67 65 20 3d 20 | 2d 31 3b 0d 20 20 20 7d |hange = |-1;. }|
|000018a0| 0d 20 20 20 65 6c 73 65 | 20 69 66 20 28 70 61 72 |. else| if (par|
|000018b0| 74 4e 75 6d 20 3d 3d 20 | 69 6e 50 61 67 65 44 6f |tNum == |inPageDo|
|000018c0| 77 6e 29 20 7b 0d 20 20 | 20 20 20 20 69 66 20 28 |wn) {. | if (|
|000018d0| 6f 6c 64 56 61 6c 20 2b | 20 73 63 72 6f 6c 6c 4c |oldVal +| scrollL|
|000018e0| 69 6e 65 73 50 65 72 50 | 61 67 65 20 20 3c 3d 20 |inesPerP|age <= |
|000018f0| 6d 61 78 29 0d 20 20 20 | 20 20 20 20 20 20 63 68 |max). | ch|
|00001900| 61 6e 67 65 20 3d 20 73 | 63 72 6f 6c 6c 4c 69 6e |ange = s|crollLin|
|00001910| 65 73 50 65 72 50 61 67 | 65 3b 0d 20 20 20 20 20 |esPerPag|e;. |
|00001920| 20 65 6c 73 65 20 69 66 | 20 28 6f 6c 64 56 61 6c | else if| (oldVal|
|00001930| 20 3c 20 6d 61 78 29 0d | 20 20 20 20 20 20 20 20 | < max).| |
|00001940| 20 63 68 61 6e 67 65 20 | 3d 20 6d 61 78 20 2d 20 | change |= max - |
|00001950| 6f 6c 64 56 61 6c 3b 0d | 20 20 20 7d 0d 20 20 20 |oldVal;.| }. |
|00001960| 65 6c 73 65 20 69 66 20 | 28 70 61 72 74 4e 75 6d |else if |(partNum|
|00001970| 20 3d 3d 20 69 6e 50 61 | 67 65 55 70 29 20 7b 0d | == inPa|geUp) {.|
|00001980| 20 20 20 20 20 20 69 66 | 20 28 6f 6c 64 56 61 6c | if| (oldVal|
|00001990| 20 2d 20 73 63 72 6f 6c | 6c 4c 69 6e 65 73 50 65 | - scrol|lLinesPe|
|000019a0| 72 50 61 67 65 20 3e 30 | 29 0d 20 20 20 20 20 20 |rPage >0|). |
|000019b0| 20 20 20 63 68 61 6e 67 | 65 20 3d 20 2d 73 63 72 | chang|e = -scr|
|000019c0| 6f 6c 6c 4c 69 6e 65 73 | 50 65 72 50 61 67 65 3b |ollLines|PerPage;|
|000019d0| 0d 20 20 20 20 20 20 65 | 6c 73 65 20 69 66 20 28 |. e|lse if (|
|000019e0| 6f 6c 64 56 61 6c 20 3e | 20 30 29 20 0d 20 20 20 |oldVal >| 0) . |
|000019f0| 20 20 20 20 20 20 63 68 | 61 6e 67 65 20 3d 20 2d | ch|ange = -|
|00001a00| 6f 6c 64 56 61 6c 3b 0d | 20 20 20 7d 3b 0d 20 20 |oldVal;.| };. |
|00001a10| 20 69 66 20 28 63 68 61 | 6e 67 65 29 20 7b 0d 20 | if (cha|nge) {. |
|00001a20| 20 20 20 20 20 53 65 74 | 43 74 6c 56 61 6c 75 65 | Set|CtlValue|
|00001a30| 28 74 68 65 43 6f 6e 74 | 72 6f 6c 2c 6f 6c 64 56 |(theCont|rol,oldV|
|00001a40| 61 6c 20 2b 20 63 68 61 | 6e 67 65 29 3b 0d 20 20 |al + cha|nge);. |
|00001a50| 20 20 20 20 69 66 20 28 | 73 63 72 6f 6c 6c 69 6e | if (|scrollin|
|00001a60| 67 48 6f 72 69 7a 6f 6e | 74 61 6c 6c 79 29 0d 20 |gHorizon|tally). |
|00001a70| 20 20 20 20 20 20 20 20 | 73 63 72 6f 6c 6c 69 6e | |scrollin|
|00001a80| 67 57 69 6e 2d 3e 64 6f | 48 53 63 72 6f 6c 6c 28 |gWin->do|HScroll(|
|00001a90| 63 68 61 6e 67 65 29 3b | 0d 20 20 20 20 20 20 65 |change);|. e|
|00001aa0| 6c 73 65 0d 20 20 20 20 | 20 20 20 20 20 73 63 72 |lse. | scr|
|00001ab0| 6f 6c 6c 69 6e 67 57 69 | 6e 2d 3e 64 6f 56 53 63 |ollingWi|n->doVSc|
|00001ac0| 72 6f 6c 6c 28 63 68 61 | 6e 67 65 29 3b 0d 20 20 |roll(cha|nge);. |
|00001ad0| 20 7d 0d 7d 0d 0d 76 6f | 69 64 20 78 57 69 6e 64 | }.}..vo|id xWind|
|00001ae0| 6f 77 3a 3a 64 6f 43 6c | 69 63 6b 28 50 6f 69 6e |ow::doCl|ick(Poin|
|00001af0| 74 20 67 6c 6f 62 61 6c | 50 74 29 20 7b 0d 20 20 |t global|Pt) {. |
|00001b00| 20 73 68 6f 72 74 20 70 | 61 72 74 4e 75 6d 3b 0d | short p|artNum;.|
|00001b10| 20 20 20 47 72 61 66 50 | 74 72 20 73 61 76 65 50 | GrafP|tr saveP|
|00001b20| 6f 72 74 3b 0d 20 20 20 | 57 69 6e 64 6f 77 50 74 |ort;. |WindowPt|
|00001b30| 72 20 77 69 6e 3b 0d 20 | 20 20 50 6f 69 6e 74 20 |r win;. | Point |
|00001b40| 6c 6f 63 61 6c 50 74 3b | 0d 20 20 20 73 68 6f 72 |localPt;|. shor|
|00001b50| 74 20 70 61 72 74 3b 0d | 20 20 20 73 68 6f 72 74 |t part;.| short|
|00001b60| 20 6f 6c 64 56 61 6c 3b | 0d 20 20 20 43 6f 6e 74 | oldVal;|. Cont|
|00001b70| 72 6f 6c 48 61 6e 64 6c | 65 20 74 68 65 43 6f 6e |rolHandl|e theCon|
|00001b80| 74 72 6f 6c 3b 0d 20 20 | 20 70 61 72 74 4e 75 6d |trol;. | partNum|
|00001b90| 20 3d 20 46 69 6e 64 57 | 69 6e 64 6f 77 28 67 6c | = FindW|indow(gl|
|00001ba0| 6f 62 61 6c 50 74 2c 26 | 77 69 6e 29 3b 0d 20 20 |obalPt,&|win);. |
|00001bb0| 20 69 66 20 28 74 68 65 | 57 69 6e 64 6f 77 20 21 | if (the|Window !|
|00001bc0| 3d 20 46 72 6f 6e 74 57 | 69 6e 64 6f 77 28 29 20 |= FrontW|indow() |
|00001bd0| 26 26 20 70 61 72 74 4e | 75 6d 20 21 3d 20 69 6e |&& partN|um != in|
|00001be0| 44 72 61 67 29 20 7b 0d | 20 20 20 20 20 53 65 6c |Drag) {.| Sel|
|00001bf0| 65 63 74 57 69 6e 64 6f | 77 28 74 68 65 57 69 6e |ectWindo|w(theWin|
|00001c00| 64 6f 77 29 3b 0d 20 20 | 20 20 20 6c 61 73 74 43 |dow);. | lastC|
|00001c10| 6c 69 63 6b 54 69 6d 65 | 20 3d 20 30 3b 0d 20 20 |lickTime| = 0;. |
|00001c20| 20 20 20 72 65 74 75 72 | 6e 3b 0d 20 20 20 7d 3b | retur|n;. };|
|00001c30| 0d 20 20 20 69 66 20 28 | 54 69 63 6b 43 6f 75 6e |. if (|TickCoun|
|00001c40| 74 28 29 20 2d 20 6c 61 | 73 74 43 6c 69 63 6b 54 |t() - la|stClickT|
|00001c50| 69 6d 65 20 3c 3d 20 47 | 65 74 44 62 6c 54 69 6d |ime <= G|etDblTim|
|00001c60| 65 28 29 20 0d 20 20 20 | 20 20 20 20 20 20 20 26 |e() . | &|
|00001c70| 26 20 61 62 73 28 67 6c | 6f 62 61 6c 50 74 2e 68 |& abs(gl|obalPt.h|
|00001c80| 20 2d 20 6c 61 73 74 43 | 6c 69 63 6b 50 74 2e 68 | - lastC|lickPt.h|
|00001c90| 29 20 3c 3d 20 33 0d 20 | 20 20 20 20 20 20 20 20 |) <= 3. | |
|00001ca0| 20 26 26 20 61 62 73 28 | 67 6c 6f 62 61 6c 50 74 | && abs(|globalPt|
|00001cb0| 2e 76 20 2d 20 6c 61 73 | 74 43 6c 69 63 6b 50 74 |.v - las|tClickPt|
|00001cc0| 2e 76 29 20 3c 3d 20 33 | 20 29 0d 20 20 20 20 20 |.v) <= 3| ). |
|00001cd0| 20 67 43 6c 69 63 6b 43 | 6f 75 6e 74 2b 2b 3b 0d | gClickC|ount++;.|
|00001ce0| 20 20 20 65 6c 73 65 0d | 20 20 20 20 20 20 67 43 | else.| gC|
|00001cf0| 6c 69 63 6b 43 6f 75 6e | 74 20 3d 20 30 3b 0d 20 |lickCoun|t = 0;. |
|00001d00| 20 20 6c 61 73 74 43 6c | 69 63 6b 50 74 20 3d 20 | lastCl|ickPt = |
|00001d10| 67 6c 6f 62 61 6c 50 74 | 3b 0d 20 20 20 6c 61 73 |globalPt|;. las|
|00001d20| 74 43 6c 69 63 6b 54 69 | 6d 65 20 3d 20 54 69 63 |tClickTi|me = Tic|
|00001d30| 6b 43 6f 75 6e 74 28 29 | 3b 0d 20 20 20 73 77 69 |kCount()|;. swi|
|00001d40| 74 63 68 20 28 70 61 72 | 74 4e 75 6d 29 20 7b 0d |tch (par|tNum) {.|
|00001d50| 20 20 20 20 20 63 61 73 | 65 20 69 6e 47 72 6f 77 | cas|e inGrow|
|00001d60| 3a 20 7b 0d 20 20 20 20 | 20 20 20 64 6f 47 72 6f |: {. | doGro|
|00001d70| 77 28 67 6c 6f 62 61 6c | 50 74 29 3b 0d 20 20 20 |w(global|Pt);. |
|00001d80| 20 20 20 20 62 72 65 61 | 6b 3b 0d 20 20 20 20 20 | brea|k;. |
|00001d90| 7d 0d 20 20 20 20 20 63 | 61 73 65 20 69 6e 47 6f |}. c|ase inGo|
|00001da0| 41 77 61 79 3a 20 7b 0d | 20 20 20 20 20 20 20 69 |Away: {.| i|
|00001db0| 66 20 28 54 72 61 63 6b | 47 6f 41 77 61 79 28 74 |f (Track|GoAway(t|
|00001dc0| 68 65 57 69 6e 64 6f 77 | 2c 67 6c 6f 62 61 6c 50 |heWindow|,globalP|
|00001dd0| 74 29 29 0d 20 20 20 20 | 20 20 20 20 20 20 43 6c |t)). | Cl|
|00001de0| 6f 73 65 28 29 3b 0d 20 | 20 20 20 20 20 20 62 72 |ose();. | br|
|00001df0| 65 61 6b 3b 0d 20 20 20 | 20 20 7d 0d 20 20 20 20 |eak;. | }. |
|00001e00| 20 63 61 73 65 20 69 6e | 44 72 61 67 3a 20 7b 0d | case in|Drag: {.|
|00001e10| 20 20 20 20 20 20 20 64 | 6f 44 72 61 67 28 67 6c | d|oDrag(gl|
|00001e20| 6f 62 61 6c 50 74 29 3b | 0d 20 20 20 20 20 20 20 |obalPt);|. |
|00001e30| 62 72 65 61 6b 3b 0d 20 | 20 20 20 20 7d 0d 20 20 |break;. | }. |
|00001e40| 20 20 20 63 61 73 65 20 | 69 6e 5a 6f 6f 6d 49 6e | case |inZoomIn|
|00001e50| 3a 20 7b 0d 20 20 20 20 | 20 20 20 64 6f 5a 6f 6f |: {. | doZoo|
|00001e60| 6d 28 70 61 72 74 4e 75 | 6d 29 3b 0d 20 20 20 20 |m(partNu|m);. |
|00001e70| 20 20 20 62 72 65 61 6b | 3b 0d 20 20 20 20 20 7d | break|;. }|
|00001e80| 0d 20 20 20 20 20 63 61 | 73 65 20 69 6e 5a 6f 6f |. ca|se inZoo|
|00001e90| 6d 4f 75 74 3a 20 7b 0d | 20 20 20 20 20 20 20 64 |mOut: {.| d|
|00001ea0| 6f 5a 6f 6f 6d 28 70 61 | 72 74 4e 75 6d 29 3b 0d |oZoom(pa|rtNum);.|
|00001eb0| 20 20 20 20 20 20 20 62 | 72 65 61 6b 3b 0d 20 20 | b|reak;. |
|00001ec0| 20 20 20 7d 0d 20 20 20 | 20 20 63 61 73 65 20 69 | }. | case i|
|00001ed0| 6e 43 6f 6e 74 65 6e 74 | 3a 20 7b 0d 20 20 20 20 |nContent|: {. |
|00001ee0| 20 20 20 20 47 65 74 50 | 6f 72 74 28 26 73 61 76 | GetP|ort(&sav|
|00001ef0| 65 50 6f 72 74 29 3b 0d | 20 20 20 20 20 20 20 20 |ePort);.| |
|00001f00| 53 65 74 50 6f 72 74 28 | 74 68 65 57 69 6e 64 6f |SetPort(|theWindo|
|00001f10| 77 29 3b 0d 20 20 20 20 | 20 20 20 20 6c 6f 63 61 |w);. | loca|
|00001f20| 6c 50 74 20 3d 20 67 6c | 6f 62 61 6c 50 74 3b 0d |lPt = gl|obalPt;.|
|00001f30| 20 20 20 20 20 20 20 20 | 47 6c 6f 62 61 6c 54 6f | |GlobalTo|
|00001f40| 4c 6f 63 61 6c 28 26 6c | 6f 63 61 6c 50 74 29 3b |Local(&l|ocalPt);|
|00001f50| 0d 20 20 20 20 20 20 20 | 20 69 66 20 28 20 28 6c |. | if ( (l|
|00001f60| 6f 63 61 6c 50 74 2e 76 | 20 3e 20 74 68 65 57 69 |ocalPt.v| > theWi|
|00001f70| 6e 64 6f 77 2d 3e 70 6f | 72 74 52 65 63 74 2e 62 |ndow->po|rtRect.b|
|00001f80| 6f 74 74 6f 6d 20 2d 20 | 31 35 20 26 26 20 28 66 |ottom - |15 && (f|
|00001f90| 65 61 74 75 72 65 73 20 | 26 20 68 61 73 48 53 63 |eatures |& hasHSc|
|00001fa0| 72 6f 6c 6c 29 29 0d 20 | 20 20 20 20 20 20 20 20 |roll)). | |
|00001fb0| 20 20 20 7c 7c 20 28 6c | 6f 63 61 6c 50 74 2e 68 | || (l|ocalPt.h|
|00001fc0| 20 3e 20 74 68 65 57 69 | 6e 64 6f 77 2d 3e 70 6f | > theWi|ndow->po|
|00001fd0| 72 74 52 65 63 74 2e 72 | 69 67 68 74 20 2d 20 31 |rtRect.r|ight - 1|
|00001fe0| 35 20 26 26 20 28 66 65 | 61 74 75 72 65 73 20 26 |5 && (fe|atures &|
|00001ff0| 20 68 61 73 56 53 63 72 | 6f 6c 6c 29 29 20 29 20 | hasVScr|oll)) ) |
|00002000| 7b 0d 20 20 20 20 20 20 | 20 20 20 20 69 66 20 28 |{. | if (|
|00002010| 20 28 70 61 72 74 20 3d | 20 46 69 6e 64 43 6f 6e | (part =| FindCon|
|00002020| 74 72 6f 6c 28 6c 6f 63 | 61 6c 50 74 2c 74 68 65 |trol(loc|alPt,the|
|00002030| 57 69 6e 64 6f 77 2c 26 | 74 68 65 43 6f 6e 74 72 |Window,&|theContr|
|00002040| 6f 6c 29 29 0d 20 20 20 | 20 20 20 20 20 20 20 20 |ol)). | |
|00002050| 20 20 20 20 26 26 20 28 | 20 74 68 65 43 6f 6e 74 | && (| theCont|
|00002060| 72 6f 6c 20 3d 3d 20 68 | 53 63 72 6f 6c 6c 20 7c |rol == h|Scroll ||
|00002070| 7c 20 74 68 65 43 6f 6e | 74 72 6f 6c 20 3d 3d 20 || theCon|trol == |
|00002080| 76 53 63 72 6f 6c 6c 20 | 29 20 29 20 7b 0d 20 20 |vScroll |) ) {. |
|00002090| 20 20 20 20 20 20 20 20 | 20 20 20 69 66 20 28 70 | | if (p|
|000020a0| 61 72 74 20 3d 3d 20 69 | 6e 54 68 75 6d 62 29 20 |art == i|nThumb) |
|000020b0| 7b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |{. | |
|000020c0| 20 20 6f 6c 64 56 61 6c | 20 3d 20 47 65 74 43 74 | oldVal| = GetCt|
|000020d0| 6c 56 61 6c 75 65 28 74 | 68 65 43 6f 6e 74 72 6f |lValue(t|heContro|
|000020e0| 6c 29 3b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |l);. | |
|000020f0| 20 20 20 20 69 66 20 28 | 54 72 61 63 6b 43 6f 6e | if (|TrackCon|
|00002100| 74 72 6f 6c 28 74 68 65 | 43 6f 6e 74 72 6f 6c 2c |trol(the|Control,|
|00002110| 6c 6f 63 61 6c 50 74 2c | 30 4c 29 29 20 7b 0d 20 |localPt,|0L)) {. |
|00002120| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002130| 20 20 69 66 20 28 74 68 | 65 43 6f 6e 74 72 6f 6c | if (th|eControl|
|00002140| 20 3d 3d 20 68 53 63 72 | 6f 6c 6c 29 0d 20 20 20 | == hScr|oll). |
|00002150| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002160| 20 20 20 64 6f 48 53 63 | 72 6f 6c 6c 28 47 65 74 | doHSc|roll(Get|
|00002170| 43 74 6c 56 61 6c 75 65 | 28 74 68 65 43 6f 6e 74 |CtlValue|(theCont|
|00002180| 72 6f 6c 29 20 2d 20 6f | 6c 64 56 61 6c 29 3b 0d |rol) - o|ldVal);.|
|00002190| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000021a0| 20 20 20 65 6c 73 65 0d | 20 20 20 20 20 20 20 20 | else.| |
|000021b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 64 6f | | do|
|000021c0| 56 53 63 72 6f 6c 6c 28 | 47 65 74 43 74 6c 56 61 |VScroll(|GetCtlVa|
|000021d0| 6c 75 65 28 74 68 65 43 | 6f 6e 74 72 6f 6c 29 20 |lue(theC|ontrol) |
|000021e0| 2d 20 6f 6c 64 56 61 6c | 29 3b 0d 20 20 20 20 20 |- oldVal|);. |
|000021f0| 20 20 20 20 20 20 20 20 | 20 20 20 7d 0d 20 20 20 | | }. |
|00002200| 20 20 20 20 20 20 20 20 | 20 20 7d 0d 20 20 20 20 | | }. |
|00002210| 20 20 20 20 20 20 20 20 | 20 65 6c 73 65 20 7b 0d | | else {.|
|00002220| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002230| 73 63 72 6f 6c 6c 69 6e | 67 57 69 6e 20 3d 20 74 |scrollin|gWin = t|
|00002240| 68 69 73 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |his;. | |
|00002250| 20 20 20 20 20 54 72 61 | 63 6b 43 6f 6e 74 72 6f | Tra|ckContro|
|00002260| 6c 28 74 68 65 43 6f 6e | 74 72 6f 6c 2c 6c 6f 63 |l(theCon|trol,loc|
|00002270| 61 6c 50 74 2c 26 78 57 | 69 6e 64 6f 77 3a 3a 43 |alPt,&xW|indow::C|
|00002280| 6f 6e 74 69 6e 75 6f 75 | 73 53 63 72 6f 6c 6c 29 |ontinuou|sScroll)|
|00002290| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 7d |;. | }|
|000022a0| 0d 20 20 20 20 20 20 20 | 20 20 20 7d 0d 20 20 20 |. | }. |
|000022b0| 20 20 20 20 20 7d 0d 20 | 20 20 20 20 20 20 20 65 | }. | e|
|000022c0| 6c 73 65 20 7b 0d 20 20 | 20 20 20 20 20 20 20 20 |lse {. | |
|000022d0| 64 6f 43 6f 6e 74 65 6e | 74 43 6c 69 63 6b 28 6c |doConten|tClick(l|
|000022e0| 6f 63 61 6c 50 74 29 3b | 0d 20 20 20 20 20 20 20 |ocalPt);|. |
|000022f0| 20 7d 3b 0d 20 20 20 20 | 20 20 20 20 53 65 74 50 | };. | SetP|
|00002300| 6f 72 74 28 73 61 76 65 | 50 6f 72 74 29 3b 0d 20 |ort(save|Port);. |
|00002310| 20 20 20 20 7d 0d 20 20 | 20 7d 20 0d 7d 0d 0d 0d | }. | } .}...|
|00002320| 76 6f 69 64 20 78 57 69 | 6e 64 6f 77 3a 3a 64 6f |void xWi|ndow::do|
|00002330| 44 72 61 67 28 50 6f 69 | 6e 74 20 67 6c 6f 62 61 |Drag(Poi|nt globa|
|00002340| 6c 50 74 29 20 7b 0d 20 | 20 20 52 65 63 74 20 64 |lPt) {. | Rect d|
|00002350| 72 61 67 52 65 63 74 3b | 0d 20 20 20 57 69 6e 64 |ragRect;|. Wind|
|00002360| 6f 77 50 74 72 20 77 69 | 6e 3b 0d 20 20 20 64 72 |owPtr wi|n;. dr|
|00002370| 61 67 52 65 63 74 20 3d | 20 73 63 72 65 65 6e 42 |agRect =| screenB|
|00002380| 69 74 73 2e 62 6f 75 6e | 64 73 3b 0d 20 20 20 49 |its.boun|ds;. I|
|00002390| 6e 73 65 74 52 65 63 74 | 28 26 64 72 61 67 52 65 |nsetRect|(&dragRe|
|000023a0| 63 74 2c 34 2c 34 29 3b | 0d 20 20 20 64 72 61 67 |ct,4,4);|. drag|
|000023b0| 52 65 63 74 2e 74 6f 70 | 20 2d 3d 20 31 35 3b 0d |Rect.top| -= 15;.|
|000023c0| 20 20 20 77 69 6e 20 3d | 20 74 68 65 57 69 6e 64 | win =| theWind|
|000023d0| 6f 77 3b 0d 20 20 20 44 | 72 61 67 57 69 6e 64 6f |ow;. D|ragWindo|
|000023e0| 77 28 77 69 6e 2c 67 6c | 6f 62 61 6c 50 74 2c 26 |w(win,gl|obalPt,&|
|000023f0| 64 72 61 67 52 65 63 74 | 29 3b 0d 7d 0d 0d 0d 76 |dragRect|);.}...v|
|00002400| 6f 69 64 20 78 57 69 6e | 64 6f 77 3a 3a 64 6f 5a |oid xWin|dow::doZ|
|00002410| 6f 6f 6d 28 73 68 6f 72 | 74 20 70 61 72 74 4e 75 |oom(shor|t partNu|
|00002420| 6d 29 20 7b 0d 20 20 20 | 52 65 63 74 20 52 3b 0d |m) {. |Rect R;.|
|00002430| 20 20 20 57 69 6e 64 6f | 77 50 74 72 20 77 69 6e | Windo|wPtr win|
|00002440| 3b 0d 20 20 20 47 72 61 | 66 50 74 72 20 73 61 76 |;. Gra|fPtr sav|
|00002450| 65 50 6f 72 74 3b 0d 20 | 20 20 52 20 3d 20 74 68 |ePort;. | R = th|
|00002460| 65 57 69 6e 64 6f 77 2d | 3e 70 6f 72 74 52 65 63 |eWindow-|>portRec|
|00002470| 74 3b 0d 20 20 20 77 69 | 6e 20 3d 20 74 68 65 57 |t;. wi|n = theW|
|00002480| 69 6e 64 6f 77 3b 0d 20 | 20 20 47 65 74 50 6f 72 |indow;. | GetPor|
|00002490| 74 28 26 73 61 76 65 50 | 6f 72 74 29 3b 0d 20 20 |t(&saveP|ort);. |
|000024a0| 20 53 65 74 50 6f 72 74 | 28 77 69 6e 29 3b 0d 20 | SetPort|(win);. |
|000024b0| 20 20 45 72 61 73 65 52 | 65 63 74 28 26 52 29 3b | EraseR|ect(&R);|
|000024c0| 0d 20 20 20 5a 6f 6f 6d | 57 69 6e 64 6f 77 28 77 |. Zoom|Window(w|
|000024d0| 69 6e 2c 70 61 72 74 4e | 75 6d 2c 30 29 3b 0d 20 |in,partN|um,0);. |
|000024e0| 20 20 49 6e 76 61 6c 52 | 65 63 74 28 26 28 77 69 | InvalR|ect(&(wi|
|000024f0| 6e 2d 3e 70 6f 72 74 52 | 65 63 74 29 29 3b 0d 20 |n->portR|ect));. |
|00002500| 20 20 69 66 20 28 20 66 | 65 61 74 75 72 65 73 20 | if ( f|eatures |
|00002510| 26 20 68 61 73 48 53 63 | 72 6f 6c 6c 20 29 0d 20 |& hasHSc|roll ). |
|00002520| 20 20 20 20 20 48 69 64 | 65 43 6f 6e 74 72 6f 6c | Hid|eControl|
|00002530| 28 68 53 63 72 6f 6c 6c | 29 3b 0d 20 20 20 69 66 |(hScroll|);. if|
|00002540| 20 28 20 66 65 61 74 75 | 72 65 73 20 26 20 68 61 | ( featu|res & ha|
|00002550| 73 56 53 63 72 6f 6c 6c | 20 29 0d 20 20 20 20 20 |sVScroll| ). |
|00002560| 20 48 69 64 65 43 6f 6e | 74 72 6f 6c 28 76 53 63 | HideCon|trol(vSc|
|00002570| 72 6f 6c 6c 29 3b 0d 20 | 20 20 53 65 74 50 6f 72 |roll);. | SetPor|
|00002580| 74 28 73 61 76 65 50 6f | 72 74 29 3b 0d 20 20 20 |t(savePo|rt);. |
|00002590| 61 64 6a 75 73 74 54 6f | 4e 65 77 53 69 7a 65 28 |adjustTo|NewSize(|
|000025a0| 29 3b 0d 7d 0d 0d 0d 76 | 6f 69 64 20 78 57 69 6e |);.}...v|oid xWin|
|000025b0| 64 6f 77 3a 3a 64 6f 47 | 72 6f 77 28 50 6f 69 6e |dow::doG|row(Poin|
|000025c0| 74 20 67 6c 6f 62 61 6c | 50 74 29 20 7b 0d 20 20 |t global|Pt) {. |
|000025d0| 20 52 65 63 74 20 73 69 | 7a 65 52 65 63 74 3b 0d | Rect si|zeRect;.|
|000025e0| 20 20 20 57 69 6e 64 6f | 77 50 74 72 20 77 69 6e | Windo|wPtr win|
|000025f0| 3b 0d 20 20 20 47 72 61 | 66 50 74 72 20 73 61 76 |;. Gra|fPtr sav|
|00002600| 65 50 6f 72 74 3b 0d 20 | 20 20 73 68 6f 72 74 20 |ePort;. | short |
|00002610| 68 65 69 67 68 74 2c 77 | 69 64 74 68 3b 0d 20 20 |height,w|idth;. |
|00002620| 20 6c 6f 6e 67 20 6e 65 | 77 53 69 7a 65 3b 0d 20 | long ne|wSize;. |
|00002630| 20 20 69 66 20 28 20 6d | 69 6e 48 20 3c 20 31 20 | if ( m|inH < 1 |
|00002640| 7c 7c 20 6d 61 78 48 20 | 3c 3d 20 6d 69 6e 48 20 ||| maxH |<= minH |
|00002650| 29 20 7b 0d 20 20 20 20 | 20 20 6d 69 6e 48 20 3d |) {. | minH =|
|00002660| 20 35 30 3b 0d 20 20 20 | 20 20 20 6d 61 78 48 20 | 50;. | maxH |
|00002670| 3d 20 33 32 30 30 30 3b | 0d 20 20 20 7d 3b 0d 20 |= 32000;|. };. |
|00002680| 20 20 69 66 20 28 20 6d | 69 6e 56 20 3c 20 31 20 | if ( m|inV < 1 |
|00002690| 7c 7c 20 6d 61 78 56 20 | 3c 3d 20 6d 69 6e 56 20 ||| maxV |<= minV |
|000026a0| 29 20 7b 0d 20 20 20 20 | 20 20 6d 69 6e 56 20 3d |) {. | minV =|
|000026b0| 20 35 30 3b 0d 20 20 20 | 20 20 20 6d 61 78 56 20 | 50;. | maxV |
|000026c0| 3d 20 33 32 30 30 30 3b | 0d 20 20 20 7d 3b 0d 20 |= 32000;|. };. |
|000026d0| 20 20 53 65 74 52 65 63 | 74 28 26 73 69 7a 65 52 | SetRec|t(&sizeR|
|000026e0| 65 63 74 2c 6d 69 6e 48 | 2c 6d 69 6e 56 2c 6d 61 |ect,minH|,minV,ma|
|000026f0| 78 48 2c 6d 61 78 56 29 | 3b 0d 20 20 20 77 69 6e |xH,maxV)|;. win|
|00002700| 20 3d 20 74 68 65 57 69 | 6e 64 6f 77 3b 0d 20 20 | = theWi|ndow;. |
|00002710| 20 69 66 20 28 20 6e 65 | 77 53 69 7a 65 20 3d 20 | if ( ne|wSize = |
|00002720| 47 72 6f 77 57 69 6e 64 | 6f 77 28 74 68 65 57 69 |GrowWind|ow(theWi|
|00002730| 6e 64 6f 77 2c 67 6c 6f | 62 61 6c 50 74 2c 26 73 |ndow,glo|balPt,&s|
|00002740| 69 7a 65 52 65 63 74 29 | 20 29 20 7b 0d 20 20 20 |izeRect)| ) {. |
|00002750| 20 20 20 68 65 69 67 68 | 74 20 3d 20 48 69 57 6f | heigh|t = HiWo|
|00002760| 72 64 28 6e 65 77 53 69 | 7a 65 29 3b 0d 20 20 20 |rd(newSi|ze);. |
|00002770| 20 20 20 77 69 64 74 68 | 20 3d 20 4c 6f 57 6f 72 | width| = LoWor|
|00002780| 64 28 6e 65 77 53 69 7a | 65 29 3b 0d 20 20 20 20 |d(newSiz|e);. |
|00002790| 20 20 47 65 74 50 6f 72 | 74 28 26 73 61 76 65 50 | GetPor|t(&saveP|
|000027a0| 6f 72 74 29 3b 0d 20 20 | 20 20 20 20 53 65 74 50 |ort);. | SetP|
|000027b0| 6f 72 74 28 77 69 6e 29 | 3b 0d 20 20 20 20 20 20 |ort(win)|;. |
|000027c0| 45 72 61 73 65 52 65 63 | 74 28 26 28 77 69 6e 2d |EraseRec|t(&(win-|
|000027d0| 3e 70 6f 72 74 52 65 63 | 74 29 29 3b 0d 20 20 20 |>portRec|t));. |
|000027e0| 20 20 20 53 69 7a 65 57 | 69 6e 64 6f 77 28 77 69 | SizeW|indow(wi|
|000027f0| 6e 2c 77 69 64 74 68 2c | 68 65 69 67 68 74 2c 30 |n,width,|height,0|
|00002800| 29 3b 0d 20 20 20 20 20 | 20 49 6e 76 61 6c 52 65 |);. | InvalRe|
|00002810| 63 74 28 26 28 77 69 6e | 2d 3e 70 6f 72 74 52 65 |ct(&(win|->portRe|
|00002820| 63 74 29 29 3b 0d 20 20 | 20 20 20 20 69 66 20 28 |ct));. | if (|
|00002830| 20 66 65 61 74 75 72 65 | 73 20 26 20 68 61 73 48 | feature|s & hasH|
|00002840| 53 63 72 6f 6c 6c 20 29 | 0d 20 20 20 20 20 20 20 |Scroll )|. |
|00002850| 20 20 48 69 64 65 43 6f | 6e 74 72 6f 6c 28 68 53 | HideCo|ntrol(hS|
|00002860| 63 72 6f 6c 6c 29 3b 0d | 20 20 20 20 20 20 69 66 |croll);.| if|
|00002870| 20 28 20 66 65 61 74 75 | 72 65 73 20 26 20 68 61 | ( featu|res & ha|
|00002880| 73 56 53 63 72 6f 6c 6c | 20 29 0d 20 20 20 20 20 |sVScroll| ). |
|00002890| 20 20 20 20 48 69 64 65 | 43 6f 6e 74 72 6f 6c 28 | Hide|Control(|
|000028a0| 76 53 63 72 6f 6c 6c 29 | 3b 0d 20 20 20 20 20 20 |vScroll)|;. |
|000028b0| 53 65 74 50 6f 72 74 28 | 73 61 76 65 50 6f 72 74 |SetPort(|savePort|
|000028c0| 29 3b 0d 20 20 20 20 20 | 20 61 64 6a 75 73 74 54 |);. | adjustT|
|000028d0| 6f 4e 65 77 53 69 7a 65 | 28 29 3b 0d 20 20 20 7d |oNewSize|();. }|
|000028e0| 0d 7d 0d 0d 0d 76 6f 69 | 64 20 78 57 69 6e 64 6f |.}...voi|d xWindo|
|000028f0| 77 3a 3a 64 6f 55 70 64 | 61 74 65 28 76 6f 69 64 |w::doUpd|ate(void|
|00002900| 29 20 7b 0d 20 20 20 47 | 72 61 66 50 74 72 20 73 |) {. G|rafPtr s|
|00002910| 61 76 65 50 6f 72 74 3b | 0d 20 20 20 57 69 6e 64 |avePort;|. Wind|
|00002920| 6f 77 50 74 72 20 77 69 | 6e 3b 0d 20 20 20 52 65 |owPtr wi|n;. Re|
|00002930| 63 74 20 62 61 64 52 65 | 63 74 3b 0d 20 20 20 50 |ct badRe|ct;. P|
|00002940| 6f 69 6e 74 20 73 61 76 | 65 50 65 6e 3b 0d 20 20 |oint sav|ePen;. |
|00002950| 20 6c 6f 6e 67 20 73 61 | 76 65 43 6f 6c 6f 72 3b | long sa|veColor;|
|00002960| 0d 20 20 20 77 69 6e 20 | 3d 20 74 68 65 57 69 6e |. win |= theWin|
|00002970| 64 6f 77 3b 0d 20 20 20 | 47 65 74 50 6f 72 74 28 |dow;. |GetPort(|
|00002980| 26 73 61 76 65 50 6f 72 | 74 29 3b 0d 20 20 20 53 |&savePor|t);. S|
|00002990| 65 74 50 6f 72 74 28 77 | 69 6e 29 3b 0d 20 20 20 |etPort(w|in);. |
|000029a0| 42 65 67 69 6e 55 70 64 | 61 74 65 28 77 69 6e 29 |BeginUpd|ate(win)|
|000029b0| 3b 0d 20 20 20 45 72 61 | 73 65 52 65 63 74 28 26 |;. Era|seRect(&|
|000029c0| 28 77 69 6e 2d 3e 70 6f | 72 74 52 65 63 74 29 29 |(win->po|rtRect))|
|000029d0| 3b 0d 20 20 20 44 72 61 | 77 43 6f 6e 74 72 6f 6c |;. Dra|wControl|
|000029e0| 73 28 77 69 6e 29 3b 0d | 20 20 20 69 66 20 28 20 |s(win);.| if ( |
|000029f0| 66 65 61 74 75 72 65 73 | 20 26 20 68 61 73 47 72 |features| & hasGr|
|00002a00| 6f 77 20 29 20 7b 0d 20 | 20 20 20 20 20 44 72 61 |ow ) {. | Dra|
|00002a10| 77 47 72 6f 77 49 63 6f | 6e 28 77 69 6e 29 3b 0d |wGrowIco|n(win);.|
|00002a20| 20 20 20 20 20 20 73 61 | 76 65 50 65 6e 20 3d 20 | sa|vePen = |
|00002a30| 74 68 65 57 69 6e 64 6f | 77 2d 3e 70 6e 53 69 7a |theWindo|w->pnSiz|
|00002a40| 65 3b 0d 20 20 20 20 20 | 20 73 61 76 65 43 6f 6c |e;. | saveCol|
|00002a50| 6f 72 20 3d 20 74 68 65 | 57 69 6e 64 6f 77 2d 3e |or = the|Window->|
|00002a60| 66 67 43 6f 6c 6f 72 3b | 0d 20 20 20 20 20 20 50 |fgColor;|. P|
|00002a70| 65 6e 53 69 7a 65 28 31 | 2c 31 29 3b 0d 20 20 20 |enSize(1|,1);. |
|00002a80| 20 20 20 46 6f 72 65 43 | 6f 6c 6f 72 28 77 68 69 | ForeC|olor(whi|
|00002a90| 74 65 43 6f 6c 6f 72 29 | 3b 0d 20 20 20 20 20 20 |teColor)|;. |
|00002aa0| 69 66 20 28 20 21 28 66 | 65 61 74 75 72 65 73 20 |if ( !(f|eatures |
|00002ab0| 26 20 68 61 73 56 53 63 | 72 6f 6c 6c 29 20 29 20 |& hasVSc|roll) ) |
|00002ac0| 7b 0d 20 20 20 20 20 20 | 20 20 20 4d 6f 76 65 54 |{. | MoveT|
|00002ad0| 6f 28 77 69 6e 2d 3e 70 | 6f 72 74 52 65 63 74 2e |o(win->p|ortRect.|
|00002ae0| 72 69 67 68 74 20 2d 20 | 31 35 2c 20 30 29 3b 0d |right - |15, 0);.|
|00002af0| 20 20 20 20 20 20 20 20 | 20 4c 69 6e 65 54 6f 28 | | LineTo(|
|00002b00| 77 69 6e 2d 3e 70 6f 72 | 74 52 65 63 74 2e 72 69 |win->por|tRect.ri|
|00002b10| 67 68 74 20 2d 20 31 35 | 2c 20 77 69 6e 2d 3e 70 |ght - 15|, win->p|
|00002b20| 6f 72 74 52 65 63 74 2e | 62 6f 74 74 6f 6d 20 2d |ortRect.|bottom -|
|00002b30| 20 31 36 29 3b 0d 20 20 | 20 20 20 20 7d 0d 20 20 | 16);. | }. |
|00002b40| 20 20 20 20 65 6c 73 65 | 20 69 66 20 28 74 6f 70 | else| if (top|
|00002b50| 53 63 72 6f 6c 6c 4f 66 | 66 73 65 74 20 3e 20 31 |ScrollOf|fset > 1|
|00002b60| 29 20 7b 0d 20 20 20 20 | 20 20 20 20 20 4d 6f 76 |) {. | Mov|
|00002b70| 65 54 6f 28 77 69 6e 2d | 3e 70 6f 72 74 52 65 63 |eTo(win-|>portRec|
|00002b80| 74 2e 72 69 67 68 74 20 | 2d 20 31 35 2c 20 30 29 |t.right |- 15, 0)|
|00002b90| 3b 0d 20 20 20 20 20 20 | 20 20 20 4c 69 6e 65 54 |;. | LineT|
|00002ba0| 6f 28 77 69 6e 2d 3e 70 | 6f 72 74 52 65 63 74 2e |o(win->p|ortRect.|
|00002bb0| 72 69 67 68 74 20 2d 20 | 31 35 2c 20 74 6f 70 53 |right - |15, topS|
|00002bc0| 63 72 6f 6c 6c 4f 66 66 | 73 65 74 20 2d 20 32 29 |crollOff|set - 2)|
|00002bd0| 3b 0d 20 20 20 20 20 20 | 7d 0d 20 20 20 20 20 20 |;. |}. |
|00002be0| 69 66 20 28 20 21 28 66 | 65 61 74 75 72 65 73 20 |if ( !(f|eatures |
|00002bf0| 26 20 68 61 73 48 53 63 | 72 6f 6c 6c 29 20 29 20 |& hasHSc|roll) ) |
|00002c00| 7b 0d 20 20 20 20 20 20 | 20 20 20 4d 6f 76 65 54 |{. | MoveT|
|00002c10| 6f 28 30 2c 77 69 6e 2d | 3e 70 6f 72 74 52 65 63 |o(0,win-|>portRec|
|00002c20| 74 2e 62 6f 74 74 6f 6d | 20 2d 20 31 35 29 3b 0d |t.bottom| - 15);.|
|00002c30| 20 20 20 20 20 20 20 20 | 20 4c 69 6e 65 54 6f 28 | | LineTo(|
|00002c40| 77 69 6e 2d 3e 70 6f 72 | 74 52 65 63 74 2e 72 69 |win->por|tRect.ri|
|00002c50| 67 68 74 20 2d 20 31 36 | 2c 20 77 69 6e 2d 3e 70 |ght - 16|, win->p|
|00002c60| 6f 72 74 52 65 63 74 2e | 62 6f 74 74 6f 6d 20 2d |ortRect.|bottom -|
|00002c70| 20 31 35 29 3b 0d 20 20 | 20 20 20 20 7d 0d 20 20 | 15);. | }. |
|00002c80| 20 20 20 20 65 6c 73 65 | 20 69 66 20 28 20 6c 65 | else| if ( le|
|00002c90| 66 74 53 63 72 6f 6c 6c | 4f 66 66 73 65 74 20 3e |ftScroll|Offset >|
|00002ca0| 20 31 20 29 20 7b 0d 20 | 20 20 20 20 20 20 20 20 | 1 ) {. | |
|00002cb0| 4d 6f 76 65 54 6f 28 30 | 2c 77 69 6e 2d 3e 70 6f |MoveTo(0|,win->po|
|00002cc0| 72 74 52 65 63 74 2e 62 | 6f 74 74 6f 6d 20 2d 20 |rtRect.b|ottom - |
|00002cd0| 31 35 29 3b 0d 20 20 20 | 20 20 20 20 20 20 4c 69 |15);. | Li|
|00002ce0| 6e 65 54 6f 28 6c 65 66 | 74 53 63 72 6f 6c 6c 4f |neTo(lef|tScrollO|
|00002cf0| 66 66 73 65 74 20 2d 20 | 32 2c 20 77 69 6e 2d 3e |ffset - |2, win->|
|00002d00| 70 6f 72 74 52 65 63 74 | 2e 62 6f 74 74 6f 6d 20 |portRect|.bottom |
|00002d10| 2d 20 31 35 29 3b 0d 20 | 20 20 20 20 20 7d 3b 0d |- 15);. | };.|
|00002d20| 20 20 20 20 20 20 50 65 | 6e 53 69 7a 65 28 73 61 | Pe|nSize(sa|
|00002d30| 76 65 50 65 6e 2e 68 2c | 73 61 76 65 50 65 6e 2e |vePen.h,|savePen.|
|00002d40| 76 29 3b 0d 20 20 20 20 | 20 20 46 6f 72 65 43 6f |v);. | ForeCo|
|00002d50| 6c 6f 72 28 73 61 76 65 | 43 6f 6c 6f 72 29 3b 0d |lor(save|Color);.|
|00002d60| 20 20 20 7d 3b 0d 20 20 | 20 62 61 64 52 65 63 74 | };. | badRect|
|00002d70| 20 3d 20 28 2a 28 77 69 | 6e 2d 3e 76 69 73 52 67 | = (*(wi|n->visRg|
|00002d80| 6e 29 29 2d 3e 72 67 6e | 42 42 6f 78 3b 0d 20 20 |n))->rgn|BBox;. |
|00002d90| 20 64 6f 52 65 64 72 61 | 77 28 26 62 61 64 52 65 | doRedra|w(&badRe|
|00002da0| 63 74 29 3b 0d 20 20 20 | 45 6e 64 55 70 64 61 74 |ct);. |EndUpdat|
|00002db0| 65 28 77 69 6e 29 3b 0d | 20 20 20 53 65 74 50 6f |e(win);.| SetPo|
|00002dc0| 72 74 28 73 61 76 65 50 | 6f 72 74 29 3b 0d 7d 0d |rt(saveP|ort);.}.|
|00002dd0| 0d 0d 76 6f 69 64 20 78 | 57 69 6e 64 6f 77 3a 3a |..void x|Window::|
|00002de0| 64 6f 41 63 74 69 76 61 | 74 65 28 69 6e 74 20 61 |doActiva|te(int a|
|00002df0| 63 74 69 76 65 29 20 7b | 0d 20 20 20 47 72 61 66 |ctive) {|. Graf|
|00002e00| 50 74 72 20 73 61 76 65 | 50 6f 72 74 3b 0d 20 20 |Ptr save|Port;. |
|00002e10| 20 52 65 63 74 20 52 3b | 0d 20 20 20 69 66 20 28 | Rect R;|. if (|
|00002e20| 61 63 74 69 76 65 29 20 | 7b 0d 20 20 20 20 20 69 |active) |{. i|
|00002e30| 66 20 28 20 66 65 61 74 | 75 72 65 73 20 26 20 68 |f ( feat|ures & h|
|00002e40| 61 73 56 53 63 72 6f 6c | 6c 20 29 0d 20 20 20 20 |asVScrol|l ). |
|00002e50| 20 20 20 20 53 68 6f 77 | 43 6f 6e 74 72 6f 6c 28 | Show|Control(|
|00002e60| 76 53 63 72 6f 6c 6c 29 | 3b 0d 20 20 20 20 20 69 |vScroll)|;. i|
|00002e70| 66 20 28 20 66 65 61 74 | 75 72 65 73 20 26 20 68 |f ( feat|ures & h|
|00002e80| 61 73 48 53 63 72 6f 6c | 6c 20 29 0d 20 20 20 20 |asHScrol|l ). |
|00002e90| 20 20 20 20 53 68 6f 77 | 43 6f 6e 74 72 6f 6c 28 | Show|Control(|
|00002ea0| 68 53 63 72 6f 6c 6c 29 | 3b 0d 20 20 20 7d 0d 20 |hScroll)|;. }. |
|00002eb0| 20 20 65 6c 73 65 20 7b | 0d 20 20 20 20 20 69 66 | else {|. if|
|00002ec0| 20 28 20 66 65 61 74 75 | 72 65 73 20 26 20 68 61 | ( featu|res & ha|
|00002ed0| 73 56 53 63 72 6f 6c 6c | 20 29 0d 20 20 20 20 20 |sVScroll| ). |
|00002ee0| 20 20 20 48 69 64 65 43 | 6f 6e 74 72 6f 6c 28 76 | HideC|ontrol(v|
|00002ef0| 53 63 72 6f 6c 6c 29 3b | 0d 20 20 20 20 20 69 66 |Scroll);|. if|
|00002f00| 20 28 20 66 65 61 74 75 | 72 65 73 20 26 20 68 61 | ( featu|res & ha|
|00002f10| 73 48 53 63 72 6f 6c 6c | 20 29 0d 20 20 20 20 20 |sHScroll| ). |
|00002f20| 20 20 20 48 69 64 65 43 | 6f 6e 74 72 6f 6c 28 68 | HideC|ontrol(h|
|00002f30| 53 63 72 6f 6c 6c 29 3b | 0d 20 20 20 7d 3b 0d 20 |Scroll);|. };. |
|00002f40| 20 20 69 66 20 28 68 61 | 73 47 72 6f 77 20 26 20 | if (ha|sGrow & |
|00002f50| 66 65 61 74 75 72 65 73 | 29 20 7b 0d 20 20 20 20 |features|) {. |
|00002f60| 20 20 52 20 3d 20 74 68 | 65 57 69 6e 64 6f 77 2d | R = th|eWindow-|
|00002f70| 3e 70 6f 72 74 52 65 63 | 74 3b 0d 20 20 20 20 20 |>portRec|t;. |
|00002f80| 20 52 2e 6c 65 66 74 20 | 3d 20 52 2e 72 69 67 68 | R.left |= R.righ|
|00002f90| 74 20 2d 20 31 34 3b 0d | 20 20 20 20 20 20 52 2e |t - 14;.| R.|
|00002fa0| 74 6f 70 20 3d 20 52 2e | 62 6f 74 74 6f 6d 20 2d |top = R.|bottom -|
|00002fb0| 20 31 34 3b 0d 20 20 20 | 20 20 20 47 65 74 50 6f | 14;. | GetPo|
|00002fc0| 72 74 28 26 73 61 76 65 | 50 6f 72 74 29 3b 0d 20 |rt(&save|Port);. |
|00002fd0| 20 20 20 20 20 53 65 74 | 50 6f 72 74 28 74 68 65 | Set|Port(the|
|00002fe0| 57 69 6e 64 6f 77 29 3b | 0d 20 20 20 20 20 20 69 |Window);|. i|
|00002ff0| 66 20 28 61 63 74 69 76 | 65 29 0d 20 20 20 20 20 |f (activ|e). |
|00003000| 20 20 20 20 49 6e 76 61 | 6c 52 65 63 74 28 26 52 | Inva|lRect(&R|
|00003010| 29 3b 0d 20 20 20 20 20 | 20 65 6c 73 65 0d 20 20 |);. | else. |
|00003020| 20 20 20 20 20 20 20 45 | 72 61 73 65 52 65 63 74 | E|raseRect|
|00003030| 28 26 52 29 3b 0d 20 20 | 20 20 20 20 53 65 74 50 |(&R);. | SetP|
|00003040| 6f 72 74 28 73 61 76 65 | 50 6f 72 74 29 3b 0d 20 |ort(save|Port);. |
|00003050| 20 20 7d 3b 0d 7d 0d 0d | 0d 76 6f 69 64 20 78 57 | };.}..|.void xW|
|00003060| 69 6e 64 6f 77 3a 3a 61 | 64 6a 75 73 74 54 6f 4e |indow::a|djustToN|
|00003070| 65 77 53 69 7a 65 28 76 | 6f 69 64 29 20 7b 0d 20 |ewSize(v|oid) {. |
|00003080| 20 20 52 65 63 74 20 62 | 6f 75 6e 64 73 3b 0d 20 | Rect b|ounds;. |
|00003090| 20 20 73 68 6f 72 74 20 | 68 65 69 67 68 74 2c 77 | short |height,w|
|000030a0| 69 64 74 68 3b 0d 20 20 | 20 57 69 6e 64 6f 77 50 |idth;. | WindowP|
|000030b0| 74 72 20 77 69 6e 3b 0d | 20 20 20 77 69 6e 20 3d |tr win;.| win =|
|000030c0| 20 74 68 65 57 69 6e 64 | 6f 77 3b 0d 20 20 20 69 | theWind|ow;. i|
|000030d0| 66 20 28 66 65 61 74 75 | 72 65 73 20 26 20 68 61 |f (featu|res & ha|
|000030e0| 73 48 53 63 72 6f 6c 6c | 29 20 7b 0d 20 20 20 20 |sHScroll|) {. |
|000030f0| 20 20 62 6f 75 6e 64 73 | 20 3d 20 77 69 6e 2d 3e | bounds| = win->|
|00003100| 70 6f 72 74 52 65 63 74 | 3b 0d 20 20 20 20 20 20 |portRect|;. |
|00003110| 62 6f 75 6e 64 73 2e 74 | 6f 70 20 3d 20 62 6f 75 |bounds.t|op = bou|
|00003120| 6e 64 73 2e 62 6f 74 74 | 6f 6d 20 2d 20 31 35 3b |nds.bott|om - 15;|
|00003130| 0d 20 20 20 20 20 20 62 | 6f 75 6e 64 73 2e 62 6f |. b|ounds.bo|
|00003140| 74 74 6f 6d 2b 2b 3b 0d | 20 20 20 20 20 20 62 6f |ttom++;.| bo|
|00003150| 75 6e 64 73 2e 6c 65 66 | 74 2d 2d 3b 0d 20 20 20 |unds.lef|t--;. |
|00003160| 20 20 20 69 66 20 28 66 | 65 61 74 75 72 65 73 20 | if (f|eatures |
|00003170| 26 20 68 61 73 47 72 6f | 77 29 0d 20 20 20 20 20 |& hasGro|w). |
|00003180| 20 20 20 20 62 6f 75 6e | 64 73 2e 72 69 67 68 74 | boun|ds.right|
|00003190| 20 2d 3d 20 31 34 3b 0d | 20 20 20 20 20 20 65 6c | -= 14;.| el|
|000031a0| 73 65 0d 20 20 20 20 20 | 20 20 20 20 62 6f 75 6e |se. | boun|
|000031b0| 64 73 2e 72 69 67 68 74 | 2b 2b 3b 0d 20 20 20 20 |ds.right|++;. |
|000031c0| 20 20 62 6f 75 6e 64 73 | 2e 6c 65 66 74 20 2b 3d | bounds|.left +=|
|000031d0| 20 6c 65 66 74 53 63 72 | 6f 6c 6c 4f 66 66 73 65 | leftScr|ollOffse|
|000031e0| 74 3b 0d 20 20 20 20 20 | 20 62 6f 75 6e 64 73 2e |t;. | bounds.|
|000031f0| 72 69 67 68 74 20 2d 3d | 20 72 69 67 68 74 53 63 |right -=| rightSc|
|00003200| 72 6f 6c 6c 4f 66 66 73 | 65 74 3b 0d 20 20 20 20 |rollOffs|et;. |
|00003210| 20 20 69 66 20 28 62 6f | 75 6e 64 73 2e 72 69 67 | if (bo|unds.rig|
|00003220| 68 74 20 3c 3d 20 62 6f | 75 6e 64 73 2e 6c 65 66 |ht <= bo|unds.lef|
|00003230| 74 29 0d 20 20 20 20 20 | 20 20 20 20 62 6f 75 6e |t). | boun|
|00003240| 64 73 2e 72 69 67 68 74 | 20 3d 20 62 6f 75 6e 64 |ds.right| = bound|
|00003250| 73 2e 6c 65 66 74 20 2b | 20 35 3b 0d 20 20 20 20 |s.left +| 5;. |
|00003260| 20 20 68 65 69 67 68 74 | 20 3d 20 62 6f 75 6e 64 | height| = bound|
|00003270| 73 2e 62 6f 74 74 6f 6d | 2d 62 6f 75 6e 64 73 2e |s.bottom|-bounds.|
|00003280| 74 6f 70 3b 0d 20 20 20 | 20 20 20 77 69 64 74 68 |top;. | width|
|00003290| 20 3d 20 62 6f 75 6e 64 | 73 2e 72 69 67 68 74 2d | = bound|s.right-|
|000032a0| 62 6f 75 6e 64 73 2e 6c | 65 66 74 3b 0d 20 20 20 |bounds.l|eft;. |
|000032b0| 20 20 20 4d 6f 76 65 43 | 6f 6e 74 72 6f 6c 28 68 | MoveC|ontrol(h|
|000032c0| 53 63 72 6f 6c 6c 2c 62 | 6f 75 6e 64 73 2e 6c 65 |Scroll,b|ounds.le|
|000032d0| 66 74 2c 62 6f 75 6e 64 | 73 2e 74 6f 70 29 3b 0d |ft,bound|s.top);.|
|000032e0| 20 20 20 20 20 20 53 69 | 7a 65 43 6f 6e 74 72 6f | Si|zeContro|
|000032f0| 6c 28 68 53 63 72 6f 6c | 6c 2c 77 69 64 74 68 2c |l(hScrol|l,width,|
|00003300| 68 65 69 67 68 74 29 3b | 0d 20 20 20 20 20 20 53 |height);|. S|
|00003310| 68 6f 77 43 6f 6e 74 72 | 6f 6c 28 68 53 63 72 6f |howContr|ol(hScro|
|00003320| 6c 6c 29 3b 0d 20 20 20 | 7d 3b 0d 20 20 20 69 66 |ll);. |};. if|
|00003330| 20 28 66 65 61 74 75 72 | 65 73 20 26 20 68 61 73 | (featur|es & has|
|00003340| 56 53 63 72 6f 6c 6c 29 | 20 7b 0d 20 20 20 20 20 |VScroll)| {. |
|00003350| 20 62 6f 75 6e 64 73 20 | 3d 20 77 69 6e 2d 3e 70 | bounds |= win->p|
|00003360| 6f 72 74 52 65 63 74 3b | 0d 20 20 20 20 20 20 62 |ortRect;|. b|
|00003370| 6f 75 6e 64 73 2e 6c 65 | 66 74 20 3d 20 62 6f 75 |ounds.le|ft = bou|
|00003380| 6e 64 73 2e 72 69 67 68 | 74 20 2d 20 31 35 3b 0d |nds.righ|t - 15;.|
|00003390| 20 20 20 20 20 20 62 6f | 75 6e 64 73 2e 72 69 67 | bo|unds.rig|
|000033a0| 68 74 2b 2b 3b 0d 20 20 | 20 20 20 20 62 6f 75 6e |ht++;. | boun|
|000033b0| 64 73 2e 74 6f 70 2d 2d | 3b 0d 20 20 20 20 20 20 |ds.top--|;. |
|000033c0| 69 66 20 28 28 66 65 61 | 74 75 72 65 73 20 26 20 |if ((fea|tures & |
|000033d0| 68 61 73 47 72 6f 77 29 | 20 7c 7c 20 28 66 65 61 |hasGrow)| || (fea|
|000033e0| 74 75 72 65 73 20 26 20 | 68 61 73 48 53 63 72 6f |tures & |hasHScro|
|000033f0| 6c 6c 29 29 0d 20 20 20 | 20 20 20 20 20 20 62 6f |ll)). | bo|
|00003400| 75 6e 64 73 2e 62 6f 74 | 74 6f 6d 20 2d 3d 20 31 |unds.bot|tom -= 1|
|00003410| 34 3b 0d 20 20 20 20 20 | 20 65 6c 73 65 0d 20 20 |4;. | else. |
|00003420| 20 20 20 20 20 20 20 62 | 6f 75 6e 64 73 2e 62 6f | b|ounds.bo|
|00003430| 74 74 6f 6d 2b 2b 3b 0d | 20 20 20 20 20 20 62 6f |ttom++;.| bo|
|00003440| 75 6e 64 73 2e 74 6f 70 | 20 2b 3d 20 74 6f 70 53 |unds.top| += topS|
|00003450| 63 72 6f 6c 6c 4f 66 66 | 73 65 74 3b 0d 20 20 20 |crollOff|set;. |
|00003460| 20 20 20 62 6f 75 6e 64 | 73 2e 62 6f 74 74 6f 6d | bound|s.bottom|
|00003470| 20 2d 3d 20 62 6f 74 74 | 6f 6d 53 63 72 6f 6c 6c | -= bott|omScroll|
|00003480| 4f 66 66 73 65 74 3b 0d | 20 20 20 20 20 20 69 66 |Offset;.| if|
|00003490| 20 28 62 6f 75 6e 64 73 | 2e 62 6f 74 74 6f 6d 20 | (bounds|.bottom |
|000034a0| 3c 3d 20 62 6f 75 6e 64 | 73 2e 74 6f 70 29 0d 20 |<= bound|s.top). |
|000034b0| 20 20 20 20 20 20 20 20 | 62 6f 75 6e 64 73 2e 62 | |bounds.b|
|000034c0| 6f 74 74 6f 6d 20 3d 20 | 62 6f 75 6e 64 73 2e 74 |ottom = |bounds.t|
|000034d0| 6f 70 20 2b 20 35 3b 0d | 20 20 20 20 20 20 68 65 |op + 5;.| he|
|000034e0| 69 67 68 74 20 3d 20 62 | 6f 75 6e 64 73 2e 62 6f |ight = b|ounds.bo|
|000034f0| 74 74 6f 6d 2d 62 6f 75 | 6e 64 73 2e 74 6f 70 3b |ttom-bou|nds.top;|
|00003500| 0d 20 20 20 20 20 20 77 | 69 64 74 68 20 3d 20 62 |. w|idth = b|
|00003510| 6f 75 6e 64 73 2e 72 69 | 67 68 74 2d 62 6f 75 6e |ounds.ri|ght-boun|
|00003520| 64 73 2e 6c 65 66 74 3b | 0d 20 20 20 20 20 20 4d |ds.left;|. M|
|00003530| 6f 76 65 43 6f 6e 74 72 | 6f 6c 28 76 53 63 72 6f |oveContr|ol(vScro|
|00003540| 6c 6c 2c 62 6f 75 6e 64 | 73 2e 6c 65 66 74 2c 62 |ll,bound|s.left,b|
|00003550| 6f 75 6e 64 73 2e 74 6f | 70 29 3b 0d 20 20 20 20 |ounds.to|p);. |
|00003560| 20 20 53 69 7a 65 43 6f | 6e 74 72 6f 6c 28 76 53 | SizeCo|ntrol(vS|
|00003570| 63 72 6f 6c 6c 2c 77 69 | 64 74 68 2c 68 65 69 67 |croll,wi|dth,heig|
|00003580| 68 74 29 3b 0d 20 20 20 | 20 20 20 53 68 6f 77 43 |ht);. | ShowC|
|00003590| 6f 6e 74 72 6f 6c 28 76 | 53 63 72 6f 6c 6c 29 3b |ontrol(v|Scroll);|
|000035a0| 0d 20 20 20 7d 3b 0d 7d | 0d 0d 76 6f 69 64 20 78 |. };.}|..void x|
|000035b0| 57 69 6e 64 6f 77 3a 3a | 46 6f 72 63 65 52 65 64 |Window::|ForceRed|
|000035c0| 72 61 77 28 52 65 63 74 | 20 2a 62 61 64 52 65 63 |raw(Rect| *badRec|
|000035d0| 74 29 20 7b 0d 20 20 20 | 47 72 61 66 50 74 72 20 |t) {. |GrafPtr |
|000035e0| 73 61 76 65 50 6f 72 74 | 3b 0d 20 20 20 47 65 74 |savePort|;. Get|
|000035f0| 50 6f 72 74 28 26 73 61 | 76 65 50 6f 72 74 29 3b |Port(&sa|vePort);|
|00003600| 0d 20 20 20 53 65 74 50 | 6f 72 74 28 74 68 65 57 |. SetP|ort(theW|
|00003610| 69 6e 64 6f 77 29 3b 0d | 20 20 20 69 66 20 28 21 |indow);.| if (!|
|00003620| 62 61 64 52 65 63 74 20 | 7c 7c 20 45 6d 70 74 79 |badRect ||| Empty|
|00003630| 52 65 63 74 28 62 61 64 | 52 65 63 74 29 29 0d 20 |Rect(bad|Rect)). |
|00003640| 20 20 20 20 20 49 6e 76 | 61 6c 52 65 63 74 28 26 | Inv|alRect(&|
|00003650| 74 68 65 57 69 6e 64 6f | 77 2d 3e 70 6f 72 74 52 |theWindo|w->portR|
|00003660| 65 63 74 29 3b 0d 20 20 | 20 65 6c 73 65 0d 20 20 |ect);. | else. |
|00003670| 20 20 20 20 49 6e 76 61 | 6c 52 65 63 74 28 62 61 | Inva|lRect(ba|
|00003680| 64 52 65 63 74 29 3b 0d | 20 20 20 53 65 74 50 6f |dRect);.| SetPo|
|00003690| 72 74 28 73 61 76 65 50 | 6f 72 74 29 3b 0d 7d 0d |rt(saveP|ort);.}.|
|000036a0| 0d 76 6f 69 64 20 78 57 | 69 6e 64 6f 77 3a 3a 47 |.void xW|indow::G|
|000036b0| 65 74 54 69 74 6c 65 28 | 53 74 72 32 35 35 20 6e |etTitle(|Str255 n|
|000036c0| 61 6d 65 29 20 7b 0d 20 | 20 20 47 65 74 57 54 69 |ame) {. | GetWTi|
|000036d0| 74 6c 65 28 74 68 65 57 | 69 6e 64 6f 77 2c 6e 61 |tle(theW|indow,na|
|000036e0| 6d 65 29 3b 0d 7d 0d 0d | 76 6f 69 64 20 78 57 69 |me);.}..|void xWi|
|000036f0| 6e 64 6f 77 3a 3a 53 65 | 74 54 69 74 6c 65 28 53 |ndow::Se|tTitle(S|
|00003700| 74 72 32 35 35 20 6e 61 | 6d 65 29 20 7b 0d 20 20 |tr255 na|me) {. |
|00003710| 20 53 65 74 57 54 69 74 | 6c 65 28 74 68 65 57 69 | SetWTit|le(theWi|
|00003720| 6e 64 6f 77 2c 6e 61 6d | 65 29 3b 0d 7d 0d 0d 69 |ndow,nam|e);.}..i|
|00003730| 6e 74 20 78 57 69 6e 64 | 6f 77 3a 3a 47 65 74 48 |nt xWind|ow::GetH|
|00003740| 56 61 6c 28 76 6f 69 64 | 29 20 7b 0d 20 20 20 72 |Val(void|) {. r|
|00003750| 65 74 75 72 6e 20 28 66 | 65 61 74 75 72 65 73 20 |eturn (f|eatures |
|00003760| 26 20 68 61 73 48 53 63 | 72 6f 6c 6c 29 3f 20 47 |& hasHSc|roll)? G|
|00003770| 65 74 43 74 6c 56 61 6c | 75 65 28 68 53 63 72 6f |etCtlVal|ue(hScro|
|00003780| 6c 6c 29 20 3a 20 30 3b | 0d 7d 0d 0d 69 6e 74 20 |ll) : 0;|.}..int |
|00003790| 78 57 69 6e 64 6f 77 3a | 3a 47 65 74 56 56 61 6c |xWindow:|:GetVVal|
|000037a0| 28 76 6f 69 64 29 20 7b | 0d 20 20 20 72 65 74 75 |(void) {|. retu|
|000037b0| 72 6e 20 28 66 65 61 74 | 75 72 65 73 20 26 20 68 |rn (feat|ures & h|
|000037c0| 61 73 56 53 63 72 6f 6c | 6c 29 3f 20 47 65 74 43 |asVScrol|l)? GetC|
|000037d0| 74 6c 56 61 6c 75 65 28 | 76 53 63 72 6f 6c 6c 29 |tlValue(|vScroll)|
|000037e0| 20 3a 20 30 3b 0d 7d 0d | 0d 76 6f 69 64 20 78 57 | : 0;.}.|.void xW|
|000037f0| 69 6e 64 6f 77 3a 3a 53 | 65 74 48 56 61 6c 28 69 |indow::S|etHVal(i|
|00003800| 6e 74 20 76 61 6c 29 20 | 7b 0d 20 20 20 73 68 6f |nt val) |{. sho|
|00003810| 72 74 20 6f 6c 64 56 61 | 6c 3b 0d 20 20 20 73 68 |rt oldVa|l;. sh|
|00003820| 6f 72 74 20 64 68 3b 0d | 20 20 20 69 66 20 28 66 |ort dh;.| if (f|
|00003830| 65 61 74 75 72 65 73 20 | 26 20 68 61 73 48 53 63 |eatures |& hasHSc|
|00003840| 72 6f 6c 6c 29 20 7b 0d | 20 20 20 20 20 20 6f 6c |roll) {.| ol|
|00003850| 64 56 61 6c 20 3d 20 47 | 65 74 43 74 6c 56 61 6c |dVal = G|etCtlVal|
|00003860| 75 65 28 68 53 63 72 6f | 6c 6c 29 3b 0d 20 20 20 |ue(hScro|ll);. |
|00003870| 20 20 20 53 65 74 43 74 | 6c 56 61 6c 75 65 28 68 | SetCt|lValue(h|
|00003880| 53 63 72 6f 6c 6c 2c 76 | 61 6c 29 3b 0d 20 20 20 |Scroll,v|al);. |
|00003890| 20 20 20 64 68 20 3d 20 | 47 65 74 43 74 6c 56 61 | dh = |GetCtlVa|
|000038a0| 6c 75 65 28 68 53 63 72 | 6f 6c 6c 29 20 2d 20 6f |lue(hScr|oll) - o|
|000038b0| 6c 64 56 61 6c 3b 0d 20 | 20 20 20 20 20 69 66 20 |ldVal;. | if |
|000038c0| 28 64 68 29 20 64 6f 48 | 53 63 72 6f 6c 6c 28 64 |(dh) doH|Scroll(d|
|000038d0| 68 29 3b 0d 20 20 20 7d | 0d 7d 0d 0d 76 6f 69 64 |h);. }|.}..void|
|000038e0| 20 78 57 69 6e 64 6f 77 | 3a 3a 53 65 74 56 56 61 | xWindow|::SetVVa|
|000038f0| 6c 28 69 6e 74 20 76 61 | 6c 29 20 7b 0d 20 20 20 |l(int va|l) {. |
|00003900| 73 68 6f 72 74 20 6f 6c | 64 56 61 6c 3b 0d 20 20 |short ol|dVal;. |
|00003910| 20 73 68 6f 72 74 20 64 | 76 3b 0d 20 20 20 69 66 | short d|v;. if|
|00003920| 20 28 66 65 61 74 75 72 | 65 73 20 26 20 68 61 73 | (featur|es & has|
|00003930| 56 53 63 72 6f 6c 6c 29 | 20 7b 0d 20 20 20 20 20 |VScroll)| {. |
|00003940| 20 6f 6c 64 56 61 6c 20 | 3d 20 47 65 74 43 74 6c | oldVal |= GetCtl|
|00003950| 56 61 6c 75 65 28 76 53 | 63 72 6f 6c 6c 29 3b 0d |Value(vS|croll);.|
|00003960| 20 20 20 20 20 20 53 65 | 74 43 74 6c 56 61 6c 75 | Se|tCtlValu|
|00003970| 65 28 76 53 63 72 6f 6c | 6c 2c 76 61 6c 29 3b 0d |e(vScrol|l,val);.|
|00003980| 20 20 20 20 20 20 64 76 | 20 3d 20 47 65 74 43 74 | dv| = GetCt|
|00003990| 6c 56 61 6c 75 65 28 76 | 53 63 72 6f 6c 6c 29 20 |lValue(v|Scroll) |
|000039a0| 2d 20 6f 6c 64 56 61 6c | 3b 0d 20 20 20 20 20 20 |- oldVal|;. |
|000039b0| 69 66 20 28 64 76 29 20 | 64 6f 48 53 63 72 6f 6c |if (dv) |doHScrol|
|000039c0| 6c 28 64 76 29 3b 0d 20 | 20 20 7d 0d 7d 0d 0d 76 |l(dv);. | }.}..v|
|000039d0| 6f 69 64 20 78 57 69 6e | 64 6f 77 3a 3a 53 65 74 |oid xWin|dow::Set|
|000039e0| 48 4c 69 6e 65 73 50 65 | 72 50 61 67 65 28 73 68 |HLinesPe|rPage(sh|
|000039f0| 6f 72 74 20 68 4c 69 6e | 65 73 29 20 7b 0d 20 20 |ort hLin|es) {. |
|00003a00| 20 69 66 20 28 68 4c 69 | 6e 65 73 20 3e 20 30 29 | if (hLi|nes > 0)|
|00003a10| 0d 20 20 20 20 20 20 68 | 4c 69 6e 65 73 50 65 72 |. h|LinesPer|
|00003a20| 50 61 67 65 20 3d 20 68 | 4c 69 6e 65 73 3b 0d 7d |Page = h|Lines;.}|
|00003a30| 0d 0d 76 6f 69 64 20 78 | 57 69 6e 64 6f 77 3a 3a |..void x|Window::|
|00003a40| 53 65 74 56 4c 69 6e 65 | 73 50 65 72 50 61 67 65 |SetVLine|sPerPage|
|00003a50| 28 73 68 6f 72 74 20 76 | 4c 69 6e 65 73 29 20 7b |(short v|Lines) {|
|00003a60| 0d 20 20 20 69 66 20 28 | 76 4c 69 6e 65 73 20 3e |. if (|vLines >|
|00003a70| 20 30 29 0d 20 20 20 20 | 20 20 76 4c 69 6e 65 73 | 0). | vLines|
|00003a80| 50 65 72 50 61 67 65 20 | 3d 20 76 4c 69 6e 65 73 |PerPage |= vLines|
|00003a90| 3b 0d 7d 0d 0d 69 6e 74 | 20 78 57 69 6e 64 6f 77 |;.}..int| xWindow|
|00003aa0| 3a 3a 47 65 74 56 4d 61 | 78 28 76 6f 69 64 29 20 |::GetVMa|x(void) |
|00003ab0| 7b 0d 20 20 20 72 65 74 | 75 72 6e 20 28 68 61 73 |{. ret|urn (has|
|00003ac0| 56 53 63 72 6f 6c 6c 20 | 26 20 66 65 61 74 75 72 |VScroll |& featur|
|00003ad0| 65 73 29 3f 20 47 65 74 | 43 74 6c 4d 61 78 28 76 |es)? Get|CtlMax(v|
|00003ae0| 53 63 72 6f 6c 6c 29 20 | 3a 20 30 3b 0d 7d 0d 0d |Scroll) |: 0;.}..|
|00003af0| 69 6e 74 20 78 57 69 6e | 64 6f 77 3a 3a 47 65 74 |int xWin|dow::Get|
|00003b00| 48 4d 61 78 28 76 6f 69 | 64 29 20 7b 0d 20 20 20 |HMax(voi|d) {. |
|00003b10| 72 65 74 75 72 6e 20 28 | 68 61 73 48 53 63 72 6f |return (|hasHScro|
|00003b20| 6c 6c 20 26 20 66 65 61 | 74 75 72 65 73 29 3f 20 |ll & fea|tures)? |
|00003b30| 47 65 74 43 74 6c 4d 61 | 78 28 68 53 63 72 6f 6c |GetCtlMa|x(hScrol|
|00003b40| 6c 29 20 3a 20 30 3b 0d | 7d 0d 0d 76 6f 69 64 20 |l) : 0;.|}..void |
|00003b50| 78 57 69 6e 64 6f 77 3a | 3a 53 65 74 48 4d 61 78 |xWindow:|:SetHMax|
|00003b60| 28 69 6e 74 20 6d 61 78 | 29 20 7b 0d 20 20 20 69 |(int max|) {. i|
|00003b70| 66 20 28 6d 61 78 20 3e | 3d 20 30 20 26 26 20 28 |f (max >|= 0 && (|
|00003b80| 66 65 61 74 75 72 65 73 | 20 26 20 68 61 73 48 53 |features| & hasHS|
|00003b90| 63 72 6f 6c 6c 29 29 0d | 20 20 20 20 20 20 53 65 |croll)).| Se|
|00003ba0| 74 43 74 6c 4d 61 78 28 | 68 53 63 72 6f 6c 6c 2c |tCtlMax(|hScroll,|
|00003bb0| 6d 61 78 29 3b 0d 7d 0d | 0d 76 6f 69 64 20 78 57 |max);.}.|.void xW|
|00003bc0| 69 6e 64 6f 77 3a 3a 53 | 65 74 56 4d 61 78 28 69 |indow::S|etVMax(i|
|00003bd0| 6e 74 20 6d 61 78 29 20 | 7b 0d 20 20 20 69 66 20 |nt max) |{. if |
|00003be0| 28 6d 61 78 20 3e 3d 20 | 30 20 26 26 20 28 66 65 |(max >= |0 && (fe|
|00003bf0| 61 74 75 72 65 73 20 26 | 20 68 61 73 56 53 63 72 |atures &| hasVScr|
|00003c00| 6f 6c 6c 29 29 0d 20 20 | 20 20 20 20 53 65 74 43 |oll)). | SetC|
|00003c10| 74 6c 4d 61 78 28 76 53 | 63 72 6f 6c 6c 2c 6d 61 |tlMax(vS|croll,ma|
|00003c20| 78 29 3b 0d 7d 0d 00 00 | 00 00 00 00 00 00 00 00 |x);.}...|........|
|00003c30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003c40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003c60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003c70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003c80| 00 00 01 00 00 00 01 3e | 00 00 00 3e 00 00 00 32 |.......>|...>...2|
|00003c90| 4e 5e 4e 75 4e 56 ff ee | 2f 07 3e 2e 00 0c 4a 47 |N^NuNV..|/.>...JG|
|00003ca0| 67 4a 2f 2e 00 08 3f 07 | 48 6e ff fe 48 6e ff fa |gJ/...?.|Hn..Hn..|
|00003cb0| 14 67 6c 6f 62 61 6c 73 | 2d 4d 61 63 53 74 61 72 |.globals|-MacStar|
|00003cc0| 74 65 72 2e 63 73 02 00 | 00 00 50 61 72 74 53 49 |ter.cs..|..PartSI|
|00003cd0| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|00003ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003cf0| 00 00 a9 80 1b 70 00 00 | 00 00 00 00 01 70 00 0c |.....p..|.....p..|
|00003d00| 28 6e 00 08 2f 0c 3f 07 | 48 6e ff fe 48 6e ff fa |(n../.?.|Hn..Hn..|
|00003d10| 48 6e ff f2 a9 8d 4a 6e | 00 0e 67 04 7c 00 60 06 |Hn....Jn|..g.|.`.|
|00003d20| 3c 3c 00 ff 52 47 20 6e | ff fa 20 50 70 00 10 28 |<<..RG n|.. Pp..(|
|00003d30| 00 11 b0 46 67 08 2f 2e | ff fa 3f 06 a9 5d be 6c |...Fg./.|..?..].l|
|00003d40| 00 a8 67 1a 3f 3c 00 01 | 2f 0c 4e ba 00 d4 39 47 |..g.?<..|/.N...9G|
|00003d50| 00 a8 42 57 2f 0c 4e ba | 00 c8 4f ef 00 0a 4c df |..BW/.N.|..O...L.|
|00003d60| 10 c0 4e 5e 4e 75 4e 56 | 00 00 2f 0c 20 6e 00 0a |..N^NuNV|../. n..|
|00003d70| 28 68 00 a0 4a 68 00 a4 | 6c 06 70 00 60 00 00 9c |(h..Jh..|l.p.`...|
|00003d80| 00 00 00 3a 00 03 00 14 | 00 00 03 48 00 17 00 5b |...:....|...H...[|
|00003d90| 04 b8 00 00 05 2a 72 75 | 6e 20 00 12 00 00 03 48 |.....*ru|n .....H|
|00003da0| 00 17 00 5b 05 4c 00 00 | 03 72 75 6e 00 12 00 00 |...[.L..|.run....|
|00003db0| 03 48 00 17 00 5b 04 4c | 00 00 03 77 69 6e 00 00 |.H...[.L|...win..|
|00003dc0| 01 00 00 00 01 3e 00 00 | 00 3e 00 00 00 32 00 68 |.....>..|.>...2.h|
|00003dd0| ac 9c 05 26 00 00 00 1c | 00 32 00 00 44 54 56 55 |...&....|.2..DTVU|
|00003de0| 00 00 00 0a 60 dd ff ff | 00 00 00 00 00 00 00 00 |....`...|........|
|00003df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+